Fix improper file handling in Win32
Merge pull request #157 from TsudaKageyu/file-win32

Fix improper file handling in Win32