Event: check that socket is alive before trigger hooks.

When the events take place in the worker epoll queue, the timeout
routine can remove and inactivate a client session, but sometimes
a write event reporeted by the same epoll_wait() loop can be queued
and can cause some inconsistences.

For safety this patch makes the read and write event connection hooks
to validate the epoll state before to proceed.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>