fix tempfile usage in tests to actually get the temp filename, instead of writing to "GLOB(...)" in CWD
on windows files open by a process have mandatory locks, so they cannot be deleted before the handles are closed
Merge pull request #1 from wchristian/win32_fixes

win32 fixes