st/mesa: fix texture memory allocation bug