ec3po: console: Detect HUP from user console
ec3po: console: Detect HUP from user console

ec3po writes to the user pty, which may or may not be open.
Since ptys have limited buffer space, we need to avoid
writing to them if they will never be drained.

ec3po now looks for HUP to indicate whether the pts is opened
or closed, and reads/writes accordingly.

BRANCH=None
BUG=b:76111225
TEST=dut-control ec_board:fizz x 400

Change-Id: Icbecb2e42b261659a006eb1b9fc6dd73490a2218
Signed-off-by: Nick Sanders <f4566bb3c90c0bf5fa0906b296b1da45051a62ee@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1014792
Reviewed-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec