httpclient: Escape inproperly encoded redirect URLs

Fixes #2187