Put queries into a global queue rather than keep a separate list of queries per thread

This means generating a report shows queries from all threads, not just the one from the thread that called collect().