[Fetcher] Add graceful shutdown (#330)
[Fetcher] Add graceful shutdown (#330)

This change makes it possible to shut down Fetcher gracefully, i.e. let
it finish all the scheduled fetching jobs before it terminates.

This capability will be used in Migrillian in 2 cases:
- When it decides to resign mastership voluntarily. In this case there
  is no point in canceling the jobs too early.
- When the server is shutting down. Stop will be called to initiate
  graceful shutdown, but the main Run context will be canceled after the
  grace period expires (in case the shutdown takes too long).
  
Finishing fetching gracefully in Migrillian will drastically increase
the chance that there will be no gaps among the migrated entries, which
minimizes recovery cost (a newly elected master simply starts from the
current tree size).
RJPercival/certificate-transparency-go,google/certificate-transparency-go,RJPercival/certificate-transparency-go,RJPercival/certificate-transparency-go,google/certificate-transparency-go,google/certificate-transparency-go,daviddrysdale/certificate-transparency-go,daviddrysdale/certificate-transparency-go,daviddrysdale/certificate-transparency-go