fix mktemp bug with Darwin(Mac OS X)
Merge pull request #20 from mcspring/mktemp_bug_cap2

mktemp bug with OSX