uart_drv: Mechanism for detecting terminal size