[AD] Rewrite some of the tests with Tracked<Float> (2) (#27767)
* Leak checking in superset_adjoint.swift
* Leak checking in method.swift.
* Add a valueWithGradient function.
* Leak checking class_method.swift.
* Leak checking for existential.swift.
* Simplify versions of gradient.
* Leak checking for e2e_differentiable_property.swift
* Leak checking for custom_derivatives.swift
* Some leak checking in array.swift
* Some leak checking in forward_mode_runtime.swift
* Formatting.
* Formatting update to test/AutoDiff/custom_derivatives.swift
Co-Authored-By: Richard Wei <rxwei@google.com>