correctly passes the environment to child procs

spawn's third argument takes an object with an env property.