When characters cannot be sent to the serial port, return an error code
so that the uclass can try again.
This fixes a problem with gnome-terminal which seems to get behind and
then drop output when a large amount of output is produced quickly (e.g.
100K in under a second). Since sandbox often writes to the device one
character at a time it does place a substantial load on the other end of
the PTY. Quite possibly it does not empty the pipe quickly enough and so
writing to the PTY fails.
Signed-off-by: Simon Glass <simon.glass@canonical.com>