test: Avoid intermittent errors in feture_index_prune.py
Summary:
The test uses the P2P network to sync blocks, which has no inherent guarantee that the blocks are sent and received in the right order, assuming the headers are received first.
This can mean that the first block file is flushed with block at height 346 and block at height 345 is added to the second file, causing assert_equal(pruneheight_new, 345) to fail.
Fix the issue by using a linear dumb sync.`
Also, after syncing the blocks, we didn't check that the indexes have caught up to the tip before manually pruning.
This could lead to prune blockers lower that the expected height.
This is a backport of core#26417 and core#31468
Test Plan: ninja check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18337