Move cs_main locking annotations from .cpp to .h
Summary:
Move cs_main locking annotations from .cpp to .h.
Backport of Bitcoin Core PR14063
https://github.com/bitcoin/bitcoin/pull/14063
Test Plan:
Maybe not necessary because are "aesthetic changes", but just in case:
- Build with Clang in Debug mode:
CXX=clang++ CC=clang cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug ninja check
- Verify that the compiler has not emitted a thread-safety warning.
- Run the node: ./src/bitcoind -regtest
- Verify that text similar to "Assertion failed: lock ... not held ..." is not printed on stderr.
Reviewers: Fabien, #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4149