[Linux] Improve checks for TTY