Fixing bug that causes socket to not return to http socket pool if there is an exception thrown in one of the handlers such as 'end'