(maint) Use host.tmpfile instead of manually generating file names

Generating a file name in /tmp/ breaks on windows, where /tmp/ can
actually point to a different path depending on if a command is
executing in a cygwin or cmd context.