REORG/MEDIUM: fd: remove FD_STCLOSE from struct fdtab

In an attempt to get rid of fdtab[].state, and to move the relevant
parts to the connection struct, we remove the FD_STCLOSE state which
can easily be deduced from the <owner> pointer as there is a 1:1 match.
REORG/MEDIUM: fd: remove checks for FD_STERROR in ev_sepoll

This test is present only in this poller as an optimization, but this
optimization adds some complexity to remove fdtab[].state. Let's get
rid of it for now.
REORG/MEDIUM: fd: get rid of FD_STLISTEN

This state was only used so that ev_sepoll did not match FD_STERROR, which
changed in previous patch. We can now safely remove this state.
REORG/MINOR: connection: move declaration to its own include file

This way we don't depend on stream_interface anymore.
REORG/MINOR: checks: put a struct connection into the server

This will be used to handle the connection state once it goes away from fdtab.
There is no functional change at the moment.
MINOR: connection: add flags to the connection struct

We're doing this to take over fdtab[].state.
MAJOR: get rid of fdtab[].state and use connection->flags instead

fdtab[].state was only used to know whether a connection was in progress
or an error was encountered. Instead we now use connection->flags to store
a flag for both. This way, connection management will be able to update the
connection status on I/O.
MINOR: fd: add a new I/O handler to fdtab

This one will eventually replace both cb[] handlers. At the moment it
is not used yet.
MEDIUM: polling: prepare to call the iocb() function when defined.

We will need this to centralize I/O callbacks. Nobody sets it right
now so the code should have no impact.
MEDIUM: checks: make use of fdtab->iocb instead of cb[]

Use the single I/O callback to handle the checks. This should soon be
replaced by the common connection handler.
MEDIUM: protocols: use the generic I/O callback for accept callbacks

This one is used only on read events, and it was easy to convert to
use the new I/O callback.
MINOR: connection: add a handler for fd-based connections

This connection handler will be used as an I/O handler for events
detected on a file descriptor. It is not used yet.
MAJOR: connection: replace direct I/O callbacks with the connection callback

Almost all direct I/O callbacks have been changed to use the connection
callback instead. Only the TCP connection validation remains.
MINOR: fd: make fdtab->owner a connection and not a stream_interface anymore

It is more convenient with a connection here and will abstract stream_interface
more easily.
MEDIUM: connection: remove the FD_POLL_* flags only once

It's inappropriate to remove FD_POLL_IN and FD_POLL_OUT in the IO callback
handlers, first because they shouldn't care about this, and second because
it will make it harder to chain multiple callers.

So let's flush these flags only once for all in the connection handler.
Right now, the HUP and ERR flags are still flushed in each IO handler to
avoid multiple calls. This will probably have to be fixed later.
MEDIUM: connection: extract the send_proxy callback from proto_tcp

This handshake handler must be independant, so move it away from
proto_tcp. It has a dedicated connection flag. It is tested before
I/O handlers and automatically removes the CO_FL_WAIT_L4_CONN flag
upon success.

It also sets the BF_WRITE_NULL flag on the stream interface and
stops the SI timeout. However it does not perform the task_wakeup(),
and relies on the data handler to do so for now. The SI wakeup will
have to be moved elsewhere anyway.
MAJOR: tcp: remove the specific I/O callbacks for TCP connection probes

Use a single tcp_connect_probe() instead of tcp_connect_write() and
tcp_connect_read(). We call this one only when no data layer function
have been processed, so this is a fallback to test for completion of
a connection attempt.

With this done, we don't have the need for any direct I/O callback
anymore.

The function still relies on ->write() to wake the stream interface up,
so it's not finished.
CLEANUP: remove the now unused fdtab direct I/O callbacks

They were all left to NULL since last commit so we can safely remove them
all now and remove the temporary dual polling logic in pollers.
MAJOR: remove the stream interface and task management code from sock_*

The socket data layer code must only focus on moving data between a
socket and a buffer. We need a special stream interface handler to
update the stream interface and the file descriptor status.

At the moment the code works but suffers from a race condition caused
by its API : the read/write callbacks still make use of the fd instead
of using the connection. And when a double shutdown is performed, a call
to ->write() after ->read() processed an error results in dereferencing
a NULL fdtab[]->owner. This is only a temporary issue which doesn't need
to be fixed now since this will automatically go away when the functions
change to use the connection instead.
MEDIUM: stream_interface: pass connection instead of fd in sock_ops

The sock_ops I/O callbacks made use of an FD till now. This has become
inappropriate and the struct connection is much more useful. It also
fixes the race condition introduced by previous change.