Make Tor's test-network.sh consistent with chutney's test-network.sh

In #27067 (moved), we fixed some bugs in chutney's test-network.sh. But we forgot to copy those changes into tor's test-network.sh.

We should update tor's test-network.sh to fix these bugs, and be consistent with chutney. And we should add a note on both sides to keep them in sync.

Edit: ticket number