mktemp bug with OSX

fix mktemp bug with Darwin(Mac OS X)