radeon: fix context destroy needing lock for flushing.
radeon: fix context destroy needing lock for flushing.

Thanks to Intel code which I've just stolen pretty much as usual.

This fixes fdo bug 22851 which is a dri1 regression since rewrite.

Tested by: fpiobaf (Fabio) on #radeon
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

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