doc: Add best practice for annotating/asserting locks
Summary:
Backport note: I removed the paragraph about LockAssertion, because the code example causes a false positive linter error, and this paragraph would anyway get removed anyway in a few commits (D10173)
This is a backport of core#19668 [5/5]
https://github.com/bitcoin/bitcoin/pull/19668/commits/ea74e10acf17903e44c85e3678853414653dd4e1
Test Plan: proofreading
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10165