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.
Rather than using Strings, wouldn't it be a bit more typesafe if you'd pass Cache interfaces as parameters? Also, I assume that this dependency stuff only works within the scope of a single cache manager. It might be obvious but might not harm to state it in the cache manager API. If you use Cache interfaces, you could say that only cache instances retrieved from this cache manager can be used for instance.