Wait for several queries to complete