Make sure that the error message for mkstemp() includes the full