glsl: don't leak memory when trying to count loop iterations