Improve getting file size in Win32

Changed to get the file size directly with Win32 ```GetFileSizeEx``` function rather than using ```tell``` and ```seek```. And also a few small fixes.