Handle multibyte characters in environment variables

Send byte size of JSON instead of string length as IO#read uses byte
lengths. If environment contains multibyte UTF-8 characters, byte size
is more than string length and read content is cropped.
Merge pull request #158 from lautis/env-multibyte-utf8

Handle multibyte characters in environment variables