shader_glsl: Fix potential memory leaks