Fix the router ignoring constraints when used together with a redirect route

Fixes the regression described in #16605 where the router would ignore any constraints when they were used together with a redirect route.

Introduced by https://github.com/rails/rails/commit/402c2af55053c2f29319091ad21fd6fa6b90ee89.