Fix mktemp to be compliant with Mac OS X