r600g: correctly handle queries which don't need begin_query
r600g: correctly handle queries which don't need begin_query

Reviewed-by: Alex Deucher <08dc22c6156113f2deff178e35e3ed9b24d6af9e@amd.com>
Reviewed-by: Christian König <c7ea837d7a46effe4232b086213468b8b31643bf@amd.com>

mapbox/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,metora/MesaGLSLCompiler,jbarczak/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,djreep81/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,bkaradzic/glsl-optimizer,metora/MesaGLSLCompiler,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer