Clear TestNode objects after shutdown
Summary:
TestNode objects need to be removed during shutdown, as setup_nodes does not remove previous TestNode objects from previous test runs during setup.
This is a backport of Core PR17288 [4/7]
https://github.com/bitcoin/bitcoin/pull/17288/commits/614c645643e86c4255b98c663c10f2c227158d4b
Depends on D8243
Test Plan: ninja && ninja check
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D8244