Update mkstemp usage to actually work