Replace LockAssertion with a proper thread safety annotations
Summary:
This is a backport of core#19979 [2/3]
https://github.com/bitcoin/bitcoin/pull/19979/commits/ab2a44297fd0796bf5797ae2a477e8e56d9c3c12
This partially revert D10161
Depends on D10171
Test Plan:
With TSAN:
ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10172