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).