httpclient: strip trailing whitespace from headers.

- we can do that according to the RFC.
- fixes #783