This is a step toward removing the Chain::Lock class and reducing cs_main
This change only affects behavior in the case where wallet last block processed
falls behind the chain tip, in which case the "Block not found in chain" error
will be stricter and not allow importing data from a blocks between the wallet
last processed tip and the current node tip.
This is part [4/12] of Core PR17954 : https://github.com/bitcoin/bitcoin/pull/17954/commits/c1694ce6bb7e19a8722d5583cd85ad17da40bb67
Depends on D7866