runsc: Pass controlling TTY by FD in the *new* process, not current process.
runsc: Pass controlling TTY by FD in the *new* process, not current process.

When setting Cmd.SysProcAttr.Ctty, the FD must be the FD of the controlling TTY
in the new process, not the current process. The ioctl call is made after
duping all FDs in Cmd.ExtraFiles, which may stomp on the old TTY FD.

This fixes the "bad address" flakes in runsc/container:container_test, although
some other flakes remain.

PiperOrigin-RevId: 216594394
Change-Id: Idfd1677abb866aa82ad7e8be776f0c9087256862

google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor