[Source] Fix issue when git's `url.<base>.insteadOf` option is used.

Fixes https://github.com/CocoaPods/CocoaPods/issues/2724,
https://github.com/CocoaPods/CocoaPods/issues/2696, and
https://github.com/CocoaPods/CocoaPods/issues/2625.