Make eof check return error cases.

If the file doesn't support lseek, chances are we want to note the error, not ignore it.