Fix race to check chaintips in p2p_headers_sync_with_minchainwork
Summary: node3 is not guaranteed to have finished syncing headers by the time getchaintips is first called.
Test Plan:
./test/functional/test_runner.py p2p_headers_sync_with_minchainwork.py
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17368