codegen: fix recursive closures by recursing into envs