intel_finalize_mipmap_tree: Add more conditions for rebuilding mipmap trees.
intel_finalize_mipmap_tree: Add more conditions for rebuilding mipmap trees.

These are taken from the i965 driver and fix corruption of some mipmap levels
under some circumsances with 945 chipsets at least.

Also flush the batchbuffer after copying data between trees, or some apps fail
an assertion elsewhere.

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