Fix seek operations failing if a previous read failed or reached the end of the file