mktemp’s template argument is required on OS X

And possibly others. Fixes #337.