Backport PR #4346: getpass() on Windows & Python 2 needs bytes prompt

Supersedes #4221.

Closes #1824.

Backport candidate for 1.2.