Fixes #18614
Previously, wait_for_getheaders only looked for the presence of a recent "getheaders" message. Additionally checking the hashstop inside the message should make tests involving wait_for_getheaders more robust.
This PR is progress towards closing issue: #18614 after PR: #18690 (merged) which introduced this check for wait_for_getdata