query_service: use accurate timeouts for queries

The fixed timeout active_pool cannot support queries with different
deadlines. Replace that with a scheme where queries can have
specific deadlines.