Fixes for [TC-1557] and [TC-1792], changes in HTTPClient.js.

This pull request contains fixes for the following issues:

- https://jira.appcelerator.org/browse/TC-1557
- https://jira.appcelerator.org/browse/TC-1792