n_tty: Fix n_tty_write crash when echoing in raw mode