[AutoDiff] Support differentiating global constant closures. (#22004)
* [AutoDiff] Support differentiating global constant closures.
* When there is a reference to a global `let` closure, we find its initializer in `@main`, trace back to the original `function_ref`, and differentiate that.
* NFC: Refactor `findReferenceToVisibleFunction` and `findWitnessMethod` to a single template.
* Add a global constant closure test that uses tensors.
* Add global differentiable closure tests.