pre-build the complete buffer of requests for pipelining

There seems to be a limit of packages (framing overhead) and system calls which
one can successfully send. This patch tries to optimize the number of packages
send by pre-building the complete batch of pipelined requests into one big
buffer.

Also, the write handling is improved so that successful writing doesn't
rely any more on the send buffer size (and network condition). Instead, the
request buffer is written in chunks when the network allows it.