[Background Fetch] Abandon fetches when service worker is unavailable.

This change adds logic to BackgroundFetch Context to observe service
worker events, specifically, unregistration, and wiping of SW database,
and implements logic for the unregistration case.

It also adds a small unit test to verify the appropriate error code is
returned when the service worker is unregistered mid-fetch.

Bug: 841385
Change-Id: I0a22489ce79bbffb7a5528c8646522c40e59a799
Reviewed-on: https://chromium-review.googlesource.com/1071651
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565287}
19 files changed