[avalanche] Consolidate duplicate code for moving proofs to conflicting pool
Summary:
A function exists to deduplicate this logic, so lets make it actually do that.
Some tweaks were made to mirror the better implementation that wasn't using the function
in the first place.
The function is templated because using ConflictingProofSet is not the correct interface,
although it might appear to be at first glance since this is currently the only use case.
This function should work on any container of ProofRefs, so I've declared it as such.
Test Plan:
ninja check-avalanche
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D11432