Follow redirects correctly

If HTTP status indicates a redirect, write head to the response to have
browsers correctly handle the redirect.