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.
Ok I see. Doesn't it get tricky when users redefine Cache configurations at runtime?
Keep in mind there are complex frameworks built on top of Infinispan Query, and most configuration things are generate dynamically - and will change (see CapeDwarf for example and imagine what happens when users push new version of their applications to the GAE engine).