glsl,mesa: add preparsed gl_resource_name, fix and optimize glGetUniformLocation and other lookups
glGetUniform and other program queries are implemented using shared "program resource" lookups. This optimizes them to decrease CPU overhead.
This helps apps that call glGetUniformLocation every frame.