[validation] make CheckSequenceLocks context-free
Summary:
Allow CheckSequenceLocks to use heights and coins from any CoinsView and
CBlockIndex provided. This means that CheckSequenceLocks() doesn't need
to hold the mempool lock or cs_main. The caller is responsible for
ensuring the CoinsView and CBlockIndex are consistent before passing
them in. The typical usage is still to create a CCoinsViewMemPool from
the mempool and grab the CBlockIndex from the chainstate tip.
This is a backport of core#20833 [1/13]
https://github.com/bitcoin/bitcoin/pull/20833/commits/42cf8b25df07c45562b7210e0e15c3fd5edb2c11
Test Plan:
With clang + debug + TSAN
ninja && ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12101