close temp file

The test can't remove the temp file on Windows, because `mkstemp()` will open the temp.