implement "pip self-check" with automatic invocation by default

initial work cribbed from PR #1214 but then I changed direction a little
Should we also set the user agent here to be able to build stats on PyPI's side which pip is requesting version checks?