Clear query cache when collection config is invalidated

We are trying to apply more index-related optimizations at compile-time to improve speed and keep the code simple. The downside of this is that queries may need to be recompiled when the index configuration changes.

For now just clear the xquery cache. The performance loss is minimal compared to the benefits of optimized queries.