ENH: core: switch to off_t and lseek in Python 3 file seeks

This removes dependency on CRT implementation details (whether
fflush/fclose actually seeks the underlying raw file handle or not).

Also, check seek error statuses.