fix reference counting for function arguments that live in closures and for closure variables in generators