tls: fix unnecessary copy of buffers when writing
Count the number of buffers that have a length > 0 before deciding to allocate and copy the supplied buffers before SSL_write().
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines