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.
No, I said already that's easy to fix.. but let's not argue on that anymore, I'm happy with any solution as long as we get one quickly. I just don't agree that throwing exceptions to the user makes it much better.