Fix thread safety error: negative handling capability
Summary:
This errors arise with some clang version and -Wthread-safety-analysis. Introduced in D11436.
Note: the annotations are also needlessely duplicated in the function definition and should be removed by backporting https://github.com/bitcoin/bitcoin/pull/21188.
Test Plan:
With a recent Clang:
ninja all check
Check it raises no warning.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D11442