[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 <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#565287}
19 files changed