glsl: protect anonymous struct id with a mutex