Add missed thread safety annotations
Summary:
This is needed for upcoming commit "sync.h: Make runtime lock checks
require compile-time lock checks" to pass.
This is a backport of core#19668 [2/5]
https://github.com/bitcoin/bitcoin/pull/19668/commits/3ddc150857178bfb1c854c05bf9b526777876f56
Depends on D10161
Test Plan:
With TSAN:
ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10162