[1.6.x] Fixed #22364 -- Sanitized getpass input in changepassword.

Python 2 getpass on Windows does not accept unicode, even
when containing on ASCII characters. Related #190807.

Backport of b5a9166f7e from master