Backport PR #6911: don't use text mode in mkstemp

causes double-encoding of newlines, preventing newline arg from having desired effect,
and resulting in CRCRLF line endings on Windows.

closes #6599
Backport PR #6281: more minor fixes to release scripts

after releasing 2.2.0

- allow `tools/release` to be run from top-level repo dir
- upload wheels