st/mesa: fix texture memory allocation bug
st/mesa: fix texture memory allocation bug

The following example caused an incorrect GL_OUT_OF_MEMORY error to be
raised in glTexSubImage2D:

   glTexImage2D(level=0, width=32, height=32, pixels=NULL);
   glTexImage2D(level=0, width=64, height=64, pixels=NULL);
   glTexSubImage2D(level=0, pixels!=NULL);

The second glTexImage2D() call needs to cause the first image to be
deallocated then reallocated at the new size.  This was not happening
because we were testing for pixels==NULL too early.

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