Report the correct exception when closing the connection fails instead o...

...f the exception that happened when trying to send