PR #13639: Fix UAF in Norm Rewriter
PR #13639: Fix UAF in Norm Rewriter

Imported from GitHub PR https://github.com/openxla/xla/pull/13639

Resolves a use-after-free when matching and rewriting layer norm patterns. See #13606.
Copybara import of the project:

--
91ebf7b4a2ac90ebadce27d1a73e88fb4513aed4 by Philipp Hack <phack@nvidia.com>:

Resolves a use-after-free in the norm rewriter.

Merging this change closes #13639

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/13639 from philipphack:u_layer_uaf_xla 91ebf7b4a2ac90ebadce27d1a73e88fb4513aed4
