This is a step toward removing the Chain::Lock class and reducing cs_main
locking.
This change only affects behavior in the case where wallet last block processed
falls behind the chain tip. The rescanblockchain error height error checking
will just be stricter in this case and only accept values up to the last
processed height
This is part [9/12] of Core PR17954 : https://github.com/bitcoin/bitcoin/pull/17954/commits/1be8ff280c78c30baabae9429c53c0bebb89c44d
Depends on D7871