#18116: backport fix to 3.3 since real-world failure mode demonstrated.

In issue 20074 it was pointed out that getpass would fail with a traceback if
stdin was, for example /dev/null, which is a non-unlikely scenario.

Also backported the tests from issue 17484 as modified by issue 18116.

(What I really did was copy getpass.py and test_getpass.py from their
state on tip as of 17bd04fbf3d3).
Mostly-null merge of #18116 backport (updated NEWS entry).
whatsnew: importlib cleanup and source_to_code add; python partial impl.
whatsnew: rewrite urllib, doctest, and poplib sections.

Also collapse redundant versionadded/versionchanged markup in
poplib.stls entry.