Workaround for access denied with NamedTemporaryFile on Windows while executing tests