Generic mktemp bugfix