[backport#16465 3/3] test: minor refactoring
[backport#16465 3/3] test: minor refactoring

Summary:
The initial commit added tests that are not relevant for us,
but also did some minor refactoring that could add more robustness
if the tests evolve in the future (remember `extra_args` in
`setup_network` in nodes are restarted).

The initial commit introduced a bug later fixed in [[https://github.com/bitcoin/bitcoin/pull/16920 | PR16920]].
This fix taken into accound here.

This concludes backport of Core [[https://github.com/bitcoin/bitcoin/pull/16465 | PR16465]] - part 3 of 3
Commit https://github.com/bitcoin/bitcoin/pull/16465/commits/fa25668e1c8982548f1c6f94780709c625811469
Depends on D8055

Test Plan: `ninja && test/functional/test_runner.py wallet_import_rescan.py`

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8056

Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc