versionbits: Use dedicated lock instead of cs_main
Summary:
This is a backport of core#19438
https://github.com/bitcoin/bitcoin/pull/19438/commits/eccd736f3dc231ac0306ca763c3b72cf8247230a
GetNextBlockScriptFlags did not require to hold cs_main since D4100
Depends on D12218
Test Plan:
with clang and debug and tsan
ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12219