Use Gnu variant of mktemp.

The OS X version seems to be broken. This is not the first time it's not
working on my machine.