Addressed an Xcode alert of using mktemp

Alert quote from Xcode:
"Call to function mktemp is insecure as it always creates or uses
insecure temporary file. Use mkstemp instead"
Merge pull request #87 from smokyonion/UsingMkstemp

Addressed an Xcode alert of using mktemp