trim: Fix bug linking incorrect programs to shaders through samplers.
Previously, the code was mapping locations returned by
glGetUniformLocation and looking in the location map to try ot
determine which program to link in a glUniform1i call. This was
entirely bogus, as distinct programs do not have distinct location
spaces.
The correct answer is to simply track the currently active program and
link it to textures being bound to shaders.