Fix serialization of client environment.

For example, `RAILS_ENV=production spring rake blah` doesn't work for me. (Could be a nice way to speed up deploys!)

Seems that `JSON.parse(ENV)` is not reliable - we need `ENV.to_hash` instead.