Use tempfile mktemp instead of hard-coding (or relying on the user to configure something in a config file)

It is generally considered best practices to use tempfile to create and manage temporary resources. tempfile.* routines are (typically) influenced by the (standard) TMPDIR environment variable.

Thanks!