Don't match Perforce repositories when outside the checkout.

We had a long-standing bug where if $P4PORT was set and `p4 info`
returned valid repository information, we'd consider that a match, even
if not within that Perforce checkout.

We now make use of the "Client root" field from `p4 info` and only match
a repository if we're within that Checkout somewhere.

If working with a nested repository where one checkout is within
another, and one type of repository is listed before another, then this
could still fail. That's, however, a larger problem that needs to be
solved across SCMClients.

Fixes bug #3171
Merge branch 'release-0.5.x'