This change prepares for upcoming commit "Do not hide compile-time
thread safety warnings" by replacing AssertLockHeld() with
LockAssertion() where needed.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19668 | core#19668]] [1/5]
https://github.com/bitcoin/bitcoin/pull/19668/commits/af9ea55a72c94678b343f5dd98dc78f3a3ac58cb
Backport note: We do not have a lock in RelayTransaction because we did
not backport [[https://github.com/bitcoin/bitcoin/pull/18044 | core#18044]] (commit
ac88e2eb619821ad7ae1d45d4b40be69051d3999)