stop using TemporaryNamedFile

It looks like Windows takes an exclusive write lock on that file when
it's created. We want to be able to open temp files in a context manager
than cleans them up automatically, which is causing errors when the file
is opened again for actual writing. Easier to create a temporary
directory.