Quit the Library Scanner event loop properly on shutdown.

We were accidentally only quitting when a scan was in progress.
Only request selection cover when selection has changed.
Don't save tracks when analysis is done. Related to Bug #1400866.

This prevents GUI hanging when analysis is complete for me.
Fix race conditions related to TrackPointer saving. Fixes Bug #1392557
and Bug #1397475.

* Change recent tracks cache to be a QCache of TrackCacheItem so that
  when a track is expired from the cache a strong reference to it is not
  lost until the track is saved. This prevents the race condition where
  the library (BaseTrackCache and friends) request track information
  during the period after the track has fallen out of the cache and
  before it is saved to the database (which results in stale data being
  shown in the library). Bug #1392557
* Fix issue where signals are blocked during shutdown so tracks are not
  saved. Bug #1397475.