Fixes to HttpConnection

Fixed an issue with the HttpConnection. The writing of parameters to
the request wasn't property syncronized.