Fixed bugs in disconnect method.
Fixed bug: Prevent multiple connection lost events from being fired when server heartbeat is missing.