Don't crash when handling onDisconnect twice.

Should fix #2.