fclose should leave the file descriptor position after the last read or written byte. (cherry picked from commit fcabc0f8)
mentioned in commit 36edecaa