Emulate texture query levels on gles
No GLES equivalent for ARB_texture_query_levels exists, but this is needed for supporting OpenGL 4.3, so emulate it by using a uniform that holds the level information.
This fixes crashes with piglits that that require this extension.
The MR builds on and supersets !419 (closed)