Use a standard method to get the temp directory

Use File::Spec's tmpdir to get a writeable directory from
the standard mechanism for tempory directories
(Usually /tmp or $ENV{TMPDIR) )