Do not hide compile-time thread safety warnings
Summary:
This is a backport of core#19668 [3/5]
https://github.com/bitcoin/bitcoin/pull/19668/commits/23d71d171e6e22ba5e4a909d597a54595b2a2c1f
Depends on D10162
Test Plan:
With TSAN:
ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10163