Calling flush_query_stats() only if DEBUG is enabled