Server shouldn't crash when the client dies

This commit makes the server not crash when the client dies
in the middle of command execution.