Fix bugs in http stats output network send code

This code just happened to work *if* the entire HTTP message
fit in the buffer in the first writev() call (which would be
the exceedingly common case), but it was horribly broken if
writev() did a partial write, generally resulting in a
neverending loop of broken EV_WRITE events that kills the
stats output thread (but doesn't really affect DNS operations).