glsl: Replace foreach_iter and iter.remove() with foreach_list_safe.