Implicit registration of an fd now only occurs when a new socket is
created (in socket() or accept()). This makes the implementation much
simpler, changes to the linux version will follow.
Reworked detection of a file descriptor being closed with epoll (in the
case of sockets it is when the remote host disconnects). Ensured that
events are only updated when they change.