Make ferror and feof checks a bit more efficient.