#14984: On POSIX, enforce permissions when reading default .netrc.

Initial patch by Bruno Piguet.

This is implemented as if a useful .netrc file could exist without passwords,
which is possible in the general case; but in fact our netrc implementation
does not support it.  Fixing that issue will be an enhancement.
Merge #14984: On POSIX, enforce permissions when reading default .netrc.
#14984: only import pwd on POSIX.
Merge #14984: only import pwd on POSIX.