closing temp files made by mkstemp