[fix] Check against a connection flag
[fix] Emit death when we are out of servers

When a server disconnects the socket, it sets the `_flag` to 1, this way we can see
if a user initiated the shutdown or the server caused it.
[fix] Adding tests