[Thread] fix ServiceDiscoveryTest
The test was flaky because we didn't give enough time for SRP
registration to complete.
The waiting should be counted as started when the SRP server is available).
Previously we started the waiting before the availability of SRP server
so the counted waiting time may be longer than expected which causes
the wait to timeout and fail the test case.
This CL also extracts some common utils from integration test cases to
the IntegrationTestUtils class.
Bug: 353836718
Test: Locally passed 50 times in a row
Change-Id: I2f648a21d57025b082296b4e562c46432ab04ff8
5 files changed