Add support to time out long running queries

Maybe we should not log the "Automatic timeout" in EE, it's way much easier to log in Java. Having a variable to store the timeout will cause extra work to do CatalogUpdate. 

The callback frequency from EE to Java is pretty frequent according to my tests, it is more or less around 2 millis. That's why I thought it is fine-grained enough to implement the timeout work on Java instead of EE.

I have another merged branch of the UI and backend work and make the querytimeout system setting live updatable. So what's our plan to merge this stuffs and what's your preference?