Upstream pick: n_tty: Fix n_tty_write crash when echoing in raw mode
http://review.cyanogenmod.org/#/c/64533/