ei: if sending a message fails, don't send any more
Any error will cause ei_disconnect() which in turn unwinds our context. Each object removed will cause an ei_send_message() to notify the server but that will only cause error messages - our socket is already gone.
Fix this by removing the source and checking if the fd is still valid before we write to it.
Fixes #47 (closed), cc @pnowack