glsl: fix a race condition when inserting new types