ISPN-4561 CacheManager.stop with indexing to Infinispan fails

https://issues.jboss.org/browse/ISPN-4561

As discussed, introduced a graph to store cache dependencies and enforce it at stop time, plus an API to interact with that. Query will register cache dependencies accordingly. Backporting should be straighforward.
Redefining a cache config doesn't affect dependency. What potentially could affect is if you remove the cache from the cache manager:  I'm not exposing the removeDependency method, so the graph could contain dead vertexes on it. It is a not a problem now, since during enforcement there are checks to see if a dependency is alive or not. 
In a multi tenant environment (CD/GAE) caches inside a cache manager can become numerous (thousands?): in this case, probably a cm.removeCache should remove from the graph as well, but in terms of effficiency the graph operations are either O(1) or O(|V|+|E|) so I guess the issue would be mostly memory usage