Fixed a bug with gnome-terminal.

gnome-terminal was causing a problem with the m_clients map, where the
state of a client would get set to 0 (instead of deleted) when the client
was destroyed. This has been fixed with a small workaround.