typeintersect: also record chained `innervars` (#50551)
On master, we only record direct `innervars` (`T` -> `S<:Val{T}`).
And chained `innervars` might be ignored (`T` -> `S<:Val{V<:T}`.
Before https://github.com/JuliaLang/julia/pull/48228, those chained
`innervars` would have been wrapped into an `UnionAll`, thus we just
need to check outer vars' lb/ub.
Test added.
~Note: this only fix
https://github.com/JuliaLang/julia/issues/50456#issuecomment-1632611284,
the other MWE still get stackoverflow.~