Use proper temp directories for each OS

Also, there was a failing test on Windows ("should shell-escape files").
You will see it if you're running tests on Windows. Make it conditional.