Use mktemp instead of the deprecated tempfile.
Merge pull request #1 from elipup/tempfilefix

Use mktemp instead of the deprecated tempfile.

Thanks @elipup, hope bash racing goes well :]