T162: Reduce memcpy() footprint
Description
Originally reported by asn: https://bugs.libssh.org/T162
We copy around a lot of buffers which results in malloc() and memcpy() calls. Try to reduce that maybe by using IO vectors and writev() and readv() in the socket layer.