Keep synthetic variables in closures

The closure extraction visitor would forget about the synthetic variables
introduced by constructions such as foreach loops.