frame: use a more Win32 friendly version of reading a file in memory
It's only used when the file cannot be mapped in memory.
This was not a real implementation of pread. As the comment suggests, the original offset was not respected. But we don't care in this case as we want to read the whole file from start to end.
pread doesn't exist on Windows nor in mingw-w64. So let's not pretend we can do it properly.
v2:
- move the code directly in the loop
- mention it's not canceleable
- clean error handling
Edited by Steve Lhomme