Improved Node.js httplib emulation.

Fixed some instances of the 'end' event being called at the wrong time.
Fix typo.

[ci:skip]
Fix Passenger Standalone complaining about the HelperAgent not being compiled during startup