ISPN-3583 When indexing is enabled but Query module isn't available configuration validation should fail

Reviving this commit after it was reverted by d6725ad00fcdfba6cc171db912ec2297f413f0ef
ISPN-3583 Use the proper classloader so this Query config validation can work in server too

If no classloader is specified then use the defining class loader of the current class. Previously, the classloader of Util class was used, which corresponds to commons module and consequently fails to load classes from query module.
ISPN-3583 Throw exception if 5.2 config activates indexing but query module is missing from class path