orphanage: Extract EraseOrphansForBlock
Summary:
Extract code that erases orphans when a new block is found into
EraseOrphansForBlock.
This is a backport of core#21148 [10/14]
https://github.com/bitcoin/bitcoin/pull/21148/commits/03257b832debcb1470420d8657d30ba30f4be770
Depends on D11487
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11489