httpclient: fix logic error for redirects