Maintain the query count if we are using a debug cursor