Fix for removing temp files on Windows

This patch fixes the problem with temp files taking gigabytes on Windows, but as long as it's Windows, regular file operations don't work reliably from Python, so some files still remain on disk (order of tens of Mb per full run).