[Serialization] support Core.IntrinsicFunction serialize/deserialize (#61086)
Added serialize and deserialize methods for Core.IntrinsicFunction
values as before this serializing would throw a method error because the
generic serialize_any path calls write() and there was no method for
intrinsic function.
Normally we'd treat this sort of closure as a regular struct but,
particularly for IR version support, we do probably prefer to have
this as a named value.
Fixes #61011
Co-authored-by: GitHub Copilot <noreply@github.com>