[ServiceWorkerCache] Fix a race in the scheduler.
If the scheduler's closure is synchronous it can wind up popping its
callback from the queue (causing the closure to be deleted if it's the
last reference) while the callback is running. If the closure holds a
refptr that owns the scheduler, bad things happen.
The fix is to hold a reference to the closure while it's running.
To make the scheduler a bit easier to read, rather than pop the queue
after the operation completes, it now pops it before running the
operation.
BUG=463782
Review URL: https://codereview.chromium.org/
978383003
Cr-Commit-Position: refs/heads/master@{#319381}