Fix a bug in CChain::GetLocator

Fix a bug introduced in #4420: it always walked back until it reaches blocks in the this chain.

This is currently not exposed, as we always call CChain::GetLocator with blocks in the main chain, but in #4468 it gets used for more.