#5 fix mktemp invocation to be BSD-compatible