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.