[avalanche] Make ProofPool's for each proof logic public
Summary:
forEachProof() can be used more generically. A follow up patch will sum immature
proof stakes in the getavalancheinfo RPC.
This patch demonstrates its usage by replacing the guts of countProofs()
Test Plan:
ninja check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12086