use bytesize on buffer string

If your character encoding is UTF-8 or some other multibyte encoding, then the message length header is incorrectly calculated.

In ruby, `String#size` returns the semantic length, but we really want `String#bytesize` here. `bytesize` has been available on `String` since at least ruby 1.8.7