Fix flaky tests in MddJobServiceTest.

- Put tests that calling scheduleIfNeeded() to a background
- Apply JobServiceCallback to check onStart or onStop executed.
- Apply ProcessLifeguardRule to prevent test crash on a background thread.
- Move JobServiceCallback to common test-util.

Test: atest -c com.android.adservices.download.MddJobServiceTest
com.android.adservices.cobalt.CobaltJobServiceTest

Bug: 306676682
Bug: 302757068
Change-Id: I241338a4e369e52aa4c8b46e5e732a571eb12f4c
4 files changed