Actually create a temp directory properly on OS X, and in a way that also works on GNU