[backport#15931 8/9] Remove locked_chain from GetDepthInMainChain and its callers
Summary:
We don't remove yet Chain locks as we need to preserve lock
order with CWallet one until swapping at once to avoid
deadlock failures (spotted by --enable-debug)
https://github.com/bitcoin/bitcoin/pull/15931/commits/b66c429c56c85fa16c309be0b2bca9c25fdd3e1a
Depends on D7512
Partial backport of PR15931
Test Plan:
ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D7513