GUACAMOLE-1776: Batch up base64 encoding to reduce syscalls.

This introduces a buffer for binary data to be encoded as base64 as well
as a buffer for the base64 encoded data, prior to any attempt to writing
it to the socket. Doing this significantly reduces the number of system
calls made by the socket-fd implementation. Instead of `clock_gettime`,
`pthread_mutex_rdlock`, and `pthread_mutex_unlock` being called for
every 3 bytes it's now called for every ~768 bytes.
3 files changed