sl2: Properly analyze the iteration variable of a for loop.

Since it's defined in the loop, it should be at most a local constant,
not a global constant.