Previously, Expect treated timeouts as successful matches, and EOF
passed even if the REPL exited abnormally. Some checks could match
the input echo alone, while completion checks required a bell that
varies between libedit versions.
The fix is to fail on timeouts, premature EOF, and abnormal exit;
check the result and prompt for Unicode input and guard against a
repeated promise rejection. Send Unicode as ASCII escapes to work
around libedit 3.1.snap20150325-2.12 on SLES 15 SP7, which reports
a character count where the readline callback expects a byte count.