Alternative fix for cross protocol redirects

This takes a somewhat earlier version of @ben's cross protocol redirect work and just extracts some bits of shared code and focuses on preserving the redirect path which was otherwise getting freed.