[avalanche] Fix the finalized proof count being wrong when pending nodes reconnect
Summary: If a finalized proof is discarded due to missing nodes, and a node later reconnects, the proof is not polled again as expected but the finalization flag is not set properly on the peer. This diff fixes the count and add a test case that reproduces the issue. Note that only the RPC output is affected by this change.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Subscribers: PiRK
Differential Revision: https://reviews.bitcoinabc.org/D14309