Add support to time out long running queries