make sure /dev/tty file handle stays open

*os.File has a finalizer which will close the file when the *os.File
gets garbage collected. Because tty is only live for the duration of
init, it will eventually get collected, and ttyFd will contain a bad
file descriptor, causing the ioctl in terminalWidth to fail.

Instead, make tty a global variable, holding either our /dev/tty file or
os.Stdin (there should be no need for using syscall.Stdin.)
Merge pull request #27 from dominikh/fix_ioctl

make sure /dev/tty file handle stays open