httpclient: strip trailing whitespace from headers.

- we can do that according to the RFC.
- fixes #783
Merge pull request #788 from zielmicha/httpclient-fix

httpclient: strip trailing whitespace from headers.