[avalanche] Fix a potential use after free issue
Summary:
There is a typo introduced in D10711. We need to access the proof associated with a peer after it gets deleted, so we copy the shared pointer. Unfortunately there is a place where the original pointer was used instead, causing a potential use after free issue.
Ref T1854.
Test Plan:
./contrib/teamcity/build-configurations.py build-asan
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Maniphest Tasks: T1854
Differential Revision: https://reviews.bitcoinabc.org/D11026