For OSX the order of parameters for mktemp matters.
Merge pull request #283 from mhaskel/osx-mktemp-fix

For OSX the order of parameters for mktemp matters.