Only close the response stream if ending the task completes the http request.
Set the stop flag when aborting the transport due to timeout.
#2180