Fix compatibility with Pypy (does not support __closure__ attribute for functions).