Close tee.stdin earlier to avoid leaving unnecessary file handles open.
Close tee.stdin earlier to avoid leaving unnecessary file handles open.

Since we're dup'ing tee.stdin, there is no need to leave it open. This
fixes a race condition where the env_syncer process keeps open a
file handle to tee, preventing tee from exiting.

Also remember to close old_stdout_fd and old_stderr_fd.

BUG=chromium-os:18104
TEST=Below.
  1. Start buildbot run.
  2. Start an interactive enter_chroot while buildbot is inside chroot.
  3. Before patch, buildbot never exits. Now, buildbot exits properly.

Change-Id: I3c0802d1f94a40cec1408f0150ab4ac794060789
Reviewed-on: http://gerrit.chromium.org/gerrit/4629
Reviewed-by: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>
Tested-by: David James <f231dc574bbeb62604660cbc162d1b8642a0a3af@chromium.org>

coreos/chromite,coreos/chromite,bpsinc-native/src_third_party_chromite,zhang0137/chromite,chadversary/chromiumos.chromite,coreos/chromite,chadversary/chromiumos.chromite,bpsinc-native/src_third_party_chromite,zhang0137/chromite,zhang0137/chromite,bpsinc-native/src_third_party_chromite