Use mktemp instead of tempfile to work on centos

From tempfile man page

BUGS
Exclusive creation is not guaranteed when creating files on NFS parti‐
tions.  tempfile is deprecated; you should use mktemp(1) instead.
Merge pull request #80 from andersjanmyr/replace_tempfile_with_mktemp

Use mktemp instead of tempfile to work on centos