make mkdtemp and mkstemp family leave template unchanged on fail