Use writev(2) instead of multiple write(2) to make sending data atomic.

Without this fix, history_gluon_add_string() is 1000 times slower than
history_gluon_add_uint() & history_gluon_add_float().