Move disconnect processing to the work queue and add more debugging