Close /dev/tty in tty_maxsize_update() if we open it
in the !isatty(fd) case to avoid leaking the descriptor.
Verify that we were actually able to open /dev/tty.
Don't leak a file descriptor and a process in x11_maxsize_update()
if fgets() fails.