Use task_util::WaitForIdle() instead of a custom one. task_util:: suports
retry scaling through environment variable.

Agent tests are still flaky.

Change-Id: I039bff5e7c698be3af2a16f4f18dbc3a66719bcc