Shut down the wrapped connection when we're asked to shut down.
Add support for deferring the actual shutdown and destruction of the
connection.