Fix race condition when starting env_syncer in enter_chroot.sh.
Fix race condition when starting env_syncer in enter_chroot.sh.

Sometimes, two processes might start the env_syncer at the same time.
If this occurs, then the pid file will get overwritten and one of the
processes won't be killed.

I've also fixed the env_syncer to properly daemonize, such that
cbuildbot won't wait on the env_syncer to be killed before exiting.
This requires closing stdin, stderr, and stdout.

BUG=chromium-os:17680
TEST=Reproduce hang, and verify that this fixes the hang. Verify that
     multiple chroots can be entered at the same time and that the
     env_syncer is killed when the last chroot exits. Verify that
     cbuildbot is not kept hanging even if the env_syncer doesn't
     exit.

Change-Id: I3cb9fbdf47a406e818e12cf91593b8e3481aa578
Reviewed-on: http://gerrit.chromium.org/gerrit/4232
Reviewed-by: Ryan Cui <5ce1592d53754a87a44fc2eb7b63d5f77cf50fdb@chromium.org>
Tested-by: David James <f231dc574bbeb62604660cbc162d1b8642a0a3af@chromium.org>

coreos/scripts,smilart/scripts,crawford/scripts,mjg59/scripts,gtank/scripts,nicescale/scripts,BugRoger/scripts,nicescale/scripts,mjg59/scripts,marineam/coreos-scripts,sigma/coreos-scripts,endocode/scripts,zhang0137/scripts,nicescale/scripts,sigma/coreos-scripts,fivethreeo/scripts,coreos/scripts,BugRoger/scripts,bcwaldon/coreos-scripts,trnubo/scripts,glevand/coreos--scripts,mjg59/scripts,gtank/scripts,andrejro/coreos--scripts,fivethreeo/scripts,mischief/scripts,bcwaldon/coreos-scripts,smilart/scripts,smilart/scripts,andrejro/coreos--scripts,vmware/coreos-scripts,gtank/scripts,zhang0137/scripts,endocode/scripts,crawford/scripts,BugRoger/scripts,crawford/scripts,fivethreeo/scripts,mischief/scripts,marineam/coreos-scripts,trnubo/scripts,andrejro/coreos--scripts,vmware/coreos-scripts,endocode/scripts,bcwaldon/coreos-scripts,vmware/coreos-scripts,trnubo/scripts,zhang0137/scripts,marineam/coreos-scripts,glevand/coreos--scripts,mischief/scripts,sigma/coreos-scripts