don't use text mode in mkstemp

causes double-encoding of newlines,
preventing newline arg from having desired effect.
Merge pull request #6911 from minrk/no-no-cr-cr-lf

don't use text mode in mkstemp