Improve type stability of array_subpadding slightly (#48136)
This should be slightly more efficient as the compiler now only tries to call
`iterate` on `t` and `s` once, and will not try to destructure the result if
the `iterate` call returns `nothing`.
This change reduce spurious JET warnings.