glsl: Fix handling of function calls inside nested loops.