[avalanche] Fix a lock order inversion on shutdown
Summary: The lock order is touchy during shutdown and was broken by D9768.
Test Plan:
With debug:
./test/functional/test_runner.py abc_p2p_proof_inventory
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D9791