support non ascii inputs in write_http_body

this makes `write_all` behave correctly when dealing will strings that have multiple bytes per character (like in UTF-8).
I think it must depend on the IO object binmode. Note that StringIO#binmode is always true.