context manager for counting queries in tests