[Background Fetch] Fix UpdateUI race condition.

The jobs were sometimes being erased before the icon was updated. The
delegate now notifies the clients after the new UI information has been
passed along.

This adds another internal Job State to the delegate to know when the
job was complete.

Bug: 917384

Change-Id: I00c599e298e342fbfafaaa9a39d5d7bcdc5cf7ba
Reviewed-on: https://chromium-review.googlesource.com/c/1388646
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619916}
10 files changed