Fix unicode filename handling on windows (hopefully closes gh-389)