Add support to time out long running queries

If it's not flaky, does that mean we can add asserts that show from the timeout message that the statement got canceled "not too long after" the timeout like within timeout + 100 millis?