Update for Modern OS X'es that don't use /tmp

Dynamically choose temporary directory on OS X, such that this works on recent OS X'es.
Merge pull request #6 from jof/patch-1

Update for Modern OS X'es that don't use /tmp