don't use text mode in mkstemp

causes double-encoding of newlines,
preventing newline arg from having desired effect.