Make mktemp compatible with OSX.

OSX uses a slightly different mktemp from Linux. Linux uses GNU mktemp, while OSX uses the BSD version.
mktemp on OSX (and presumably BSD) returns an error if no arguments are supplied. Supplying some default name makes both GNU and BSD mktemp happy.

Tested on OSX 10.7, 10.8, Fedora 14 (Linux 2.6.35.14)
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)
Merge pull request #1 from ch41rmn/master

OSX compatibility