Handle cross-host redirects with plain Net::HTTP

This adds a failing test corresponding to the infinite redirect issue #2451 and also solves it in a way that does not assume all redirects go to the same host