Fix check for pickling closures

Only closures on the outer-most function don't work.
Internal closures that fully resolve should still be fine.