This adds a test for an edge case that caused an intermittent bug for Bitcoin Core. The bug should not affect Bitcoin ABC, as the fix was squashed with the feature in D11145.
The number of blocks to generate and to prune had to be adjusted for the test to work, because we can fit more block per `blk?????.dat` file (no witness data in our coinbase transaction) and pruning removes blocks from entire files at once.
This concludes backport of [[https://github.com/bitcoin/bitcoin/pull/23365 | core#23365]]
https://github.com/bitcoin/bitcoin/pull/23365/commits/9600ea01450b0d39be90eb2971c1ac5c9b69a66e
Depends on D11146