Clean up "close socket" routines.

We use the new rbtree DeleteOrder when walking over the packet list.
When the "eol tcp/proxy listener" callback is run, it can return
"please delete this node", instead of calling rbtree_delete.

Doing that allows the walker to be aware of deletions, unlike
before.

This turned out to make the code simpler, and the whole event fd
handling has become more robust.
Rewrite the modcall MOD_* handlers.  Updates #404.

The old code wasn't worth debugging.  With a few hours work,
the new code is simpler, more understandable, and avoids the
bug entirely.