Add compile time checking for all cs_main runtime locking assertions
Summary:
This turned out to be fairly different from the original due to numerous changes in our codebase.
This is a backport of Core PR13083
Test Plan:
ninja all check
Using clang as a compiler
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D4094