When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty. Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE.
When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these two events arrive, the Fiber and IO object need to be removed from the other @readable or @writable list.
Fix example fiber scheduler reg. writable events
There were two issues:
When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty.
Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE.
When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these
two events arrive, the Fiber and IO object need to be removed from the other
@readableor@writablelist.