Fixes #29508.
Make sure that v2 handshake is complete before comparing getpeerinfo outputs so that transport_protocol_type isn't stuck at 'detecting'.
This is done by adding a wait_until statement till transport_protocol_type = v2 so that bitcoind waits until the v2 handshake is complete. (on the python side, this is ensured by default since wait_for_handshake = True inside add_p2p_connection())