Merge #14984: only import pwd on POSIX.

Since we have fine grained import locks in 3.4, I moved the
import to where it is actually needed.