Be more careful with synchronization in RepositoryCache
Ensure that EGit doesn't use nested locking of the RepositoryCache and
the IndexDiffCache. Otherwise deadlocks can occur between a new
IndexDiffCacheEntry being created and pruning or clearing the
RepositoryCache (lock inversion).
Also ensure that stopping the bundle shuts down in the inverse order
things were started. Stop listeners and cancel and wait for jobs before
shutting down global caches, then shut down down the caches in the
inverse order they were started.
Bug: 507359
Change-Id: If5fafdbbb88e4421eb4ea15380542d5c03ca248e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>