PR description:
> This PR replaces LockAssertion with AssertLockHeld, and removes LockAssertion.
>
> This PR is compared with alternatives in https://github.com/bitcoin-core/bitcoin-devwiki/wiki/AssertLockHeld-PRs
This is a backport of core#19979 [1/3]
https://github.com/bitcoin/bitcoin/pull/19979/commits/73f71e19965e07534eb47701f2b23c9ed59ef475