Fix bug #64979: Wrong behavior of static variables in closure generators