Use a faster approach to testing query ID reuse

The old test tried 100,000 queries in sequence to test for leaks.
This normally took about 10 seconds, but was sometimes observed
to take much longer for unknown reasons.

This new test is much narrower, but largely covers the same
functionality and completes in about 10ms.

Test: New test passes
Change-Id: I2fd70f73c2877ce7d49579bb299592fc1acab408
1 file changed