lib,src: fix spawnSync ignoring its 'env' option

PR-URL: https://github.com/joyent/node/pull/8546
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
test: add test for spawnSync() env option

PR-URL: https://github.com/joyent/node/pull/8845
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Merge branch 'v0.12' of github.com:/andrewlow/node into v0.12-ppc