MarkBlockAsReceived() should not be used for both removing the block
from mapBlocksInFlight and checking whether it was in the map.
This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/22141 | core#22141]]
https://github.com/bitcoin/bitcoin/pull/22141/commits/62993507336be06490b202b3955d4830a99e9e34
Depends on D12707