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

initial work cribbed from PR #1214 but then I changed direction a little
If we're using the ``PipSession`` class then the user agent is already set. The other headers should be added just because it's cleaner IMO.