Use tempfile.mkstemp where applicable.

Among other things, this makes tmpfiles respect TMPDIR.
Bump version.