use StringIO to process String request body

This solves an Encoding compatibility issue (#266) with concatenating
the request and body. Also solves an issue with ruby-1.8.7 when using a
large string body, as the socket writes are now chunked.