mesa: make glTexImage, glCompressedTexImage proxy code more alike