[avalanche] Reset the proof tracking state on peer disconnection
Summary:
This makes it possible to select another peer for requesting a proof if
the one currently selected get disconnected.
This introduces a lock order inversion found by TSAN for which I added
an exception: during shutdown the cs_main locks is hold before calling
CConnman::StopNodes(). This lock is held (as well as cs_orphans) for
the sake of fixing a potential lock order invertion already that could
only occur during shutdown.
Depends on D9599.
Test Plan:
ninja all check
With and without TSAN:
./test/functional/test_runner.py p2p_inv_download
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Maniphest Tasks: T1611
Differential Revision: https://reviews.bitcoinabc.org/D9600