The issue is that temporary files on windows need a `O_TEMPORARY` flag that doesn't seem to be supported. Solution: create a temporary file manually in the script directory.