Fix #7295, #4513

Replaces tty_rows()/tty_cols() with tty_size(), which calls
uv_tty_get_winsize() to get the terminal size