Network backend: Add delayed error reporting
Network backend: Add delayed error reporting

The server returns two integer codes.
The first one is returned right after the WRITEBUF command is issued,
and corresponds to the error code returned when the server attempted
to open the device.
If zero, a second error code is returned, that corresponds (if positive)
to the number of bytes written.

Before, the network backend would wait for the first error code before
sending its WRITEBUF command, and then wait for the second error code
before returning.

To speed things up, we delay error reporting. We just send out the
data without reading the error code that the server gives us, because
the answer will take too much time. If errors occured, they will be
reported by the next call to iio_buffer_push().

The benefits depend on the buffer size, the latency of the network and
the response time of the server.

When streaming to a ZedBoard + FMCOMMS2, using a buffer size of
0x1000 samples the transfer speed went from 2.1 MSPS to 3.2 MSPS
(32 bits per sample).
When using a buffer size of 0x10000 samples, the transfer speed went
from 10.3 MSPS to 18 MSPS.

Signed-off-by: Paul Cercueil <73d292422978d45c9eeef455bb1b24a0db453722@analog.com>

gburca/libiio,analogdevicesinc/libiio,gburca/libiio,sensarliar/libiio,Sunderfield/libiio,analogdevicesinc/libiio,sensarliar/libiio,gburca/libiio,Sunderfield/libiio,Sunderfield/libiio,sensarliar/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio