Started to factor out the disconnect logic to DisconnetListener. Yet
missing is the graceful disconnect logic (wait for outstanding receipts
and message handlers).