remove more uses of mkstemp