message: Use LockAssertion utility class instead of AssertLockHeld()
  This change prepares for upcoming commit "Do not hide compile-time
  thread safety warnings" by replacing AssertLockHeld() with
  LockAssertion() where needed.
diff: @@ -671,13 +671,12 @@ static void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman& connma
  }
  }
  connman.ForNode(nodeid, [&connman](CNode* pfrom){
  - AssertLockHeld(cs_main);
  + LockAssertion lock(::cs_main);
  uint64_t nCMPCTBLOCKVersion = (pfrom->GetLocalServices() & NODE_WITNESS) ? 2 : 1;
  if (lNodesAnnouncingHeaderAndIDs.size() >= 3) {
  // As per BIP152, we only get 3 of our peers to announce
  // blocks using compact encodings.
  connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [&connman, nCMPCTBLOCKVersion](CNode* pnodeStop){
  - AssertLockHeld(cs_main);
  connman.PushMessage(pnodeStop, CNetMsgMaker(pnodeStop->GetSendVersion()).Make(NetMsgType::SENDCMPCT, /*fAnnounceUsingCMPCTBLOCK=*/false, nCMPCTBLOCKVersion));
  return true;
  });
  @@ -1373,7 +1372,7 @@ void PeerLogicValidation::NewPoWValidBlock(const CBlockIndex *pindex, const std:
  }
  m_connman.ForEachNode([this, &pcmpctblock, pindex, &msgMaker, fWitnessEnabled, &hashBlock](CNode* pnode) {
  - AssertLockHeld(cs_main);
  + LockAssertion lock(::cs_main);
  // TODO: Avoid the repeated-serialization here
  if (pnode->nVersion < INVALID_CB_NO_BAN_VERSION || pnode->fDisconnect)
  @@ -1515,7 +1514,8 @@ void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman&
  {
  connman.ForEachNode([&txid, &wtxid](CNode* pnode)
  {
  - AssertLockHeld(cs_main);
  + LockAssertion lock(::cs_main);
  +
  CNodeState &state = *State(pnode->GetId());
  if (state.m_wtxid_relay) {
  pnode->PushTxInventory(wtxid);
  @@ -4104,7 +4104,7 @@ void PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds)
  int64_t oldest_block_announcement = std::numeric_limits<int64_t>::max();
  m_connman.ForEachNode([&](CNode* pnode) {
  - AssertLockHeld(cs_main);
  + LockAssertion lock(::cs_main);
  // Ignore non-outbound peers, or nodes marked for disconnect already
  if (!pnode->IsOutboundOrBlockRelayConn() || pnode->fDisconnect) return;
  @@ -4121,7 +4121,7 @@ void PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds)
  });
  if (worst_peer != -1) {
  bool disconnected = m_connman.ForNode(worst_peer, [&](CNode *pnode) {
  - AssertLockHeld(cs_main);
  + LockAssertion lock(::cs_main);
  // Only disconnect a peer that has been connected to us for
  // some reasonable fraction of our check-frequency, to give
  