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).
IO#write is supposed to return the number of bytes written so it's not a problem (in theory).