Cancels statistics callbacks and releases the resources of all owned streams.
Call close to disconnect the socket before disposing of the connection.