tmp file in default tmp directory

No longer assumes tmp files are made in the /tmp directory. Temporary files are now made in $TMPDIR if it is defined, or defaults to /tmp if it is not defined (according to both GNU and BSD conventions)