[Pallas] Cache lowered `pjit` helper functions in Mosaic TPU lowering.
`jaxpr_subcomp` previously cached individual primitive lowering rules via `_emit_pallas_lowering_rule_as_fun`, while `pjit` equations inside a Pallas kernel body were inlined into the caller block on every call (`pjit` was in `_uncacheable_primitives`). When a `@jax.jit`-decorated helper function is invoked repeatedly inside a kernel body with identical input/output abstract values and parameters, inlining duplicates its entire MLIR body at every call site.
Allow `pjit.jit_p` equations whose body `Jaxpr` is closed and free of uncacheable primitives (`_is_cacheable_jaxpr`) to be lowered once into a cached `func.FuncOp` and called at each call site. When the `pjit` body references grid-index primitives (`program_id_p`, `axis_index_p`), include `grid_arity` in `PallasLoweringCacheKey` so `user_grid_indices` are forwarded through the cached `FuncOp` signature.
PiperOrigin-RevId: 1013976590