pcm: Add error handler for `fgets`