Update ScopedTaskEnvironment to be resilient to tests quitting the RunLoop

Various tests (such as those using PipelineIntegrationTestBase::Seek()
and similar) use the (deprecated) MessageLoop::QuitWhenIdleClosure() or
RunLoop::QuitCurrentWhenIdleDeprecated().
That usage was previously incompatible with
ScopedTaskEnvironment::RunUntilIdle(), which expects its run_loop to
execute the OnQueueEmptyClosure (which is a OnceClosure). This was
causing things like media_pipeline_integration_fuzzer's ::Seek() to
crash due to the Seek completion having quit the run_loop without
running the ScopedTaskEnvironment's OnQueueEmptyClosure.

This change implements fdoray@'s suggestion (in lieu of fixing all
the related deprecated test usages for now) to just restart
ScopedTaskEnvironment::RunUntilIdle() in such cases.

BUG=751011,708584
R=fdoray@chromium.org
TEST=Locally on linux, crashing fuzzer case runs to completion, and no media_unittests regression

Change-Id: Id99fe93e1eddfaa83bc90fa1ac61ce96c5ac6999
Reviewed-on: https://chromium-review.googlesource.com/604504
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Francois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493066}
1 file changed