Requests after the first on a keepalive connection remove themselves
from the keepalive timeout queue. This presents a race condition where
the main thread might try to access the first element of the queue
after it has been removed.
we have the possibility to pass a data payload to the poller when
registering a file object. We are using this possibility to pass a
callback. the callback will either accept or handle a connection when
the read event is triggered.
while I am here make the future result asynchronous so we don't block
the I/O event handling.
this change initialise the event loop after the process has forked so we
make sure to inherit from the file descriptor.
Also fix the number of events we are waiting for. The python
implementation requires a positive number.