Shut down http connection on error

Fully shut down the connection