correct use of mkstemp