Fix: cleanly shutdown an ssl connection.

A clean SSL connection "shutdown" requires some data exchange through
the use of the SSL_shutdown() regular method.

Also call it up to 4 times. It eventually needs to be resumed for a complete & clean shutdown.
Prevent exception: [Errno 107] Transport endpoint is not connected.