fixed a bug in the logic taking care of expiing timeouts

the bug was introduced in some late change while integrating the kqueue implementation
fixed the kqueue implementation to properly register write events