Don't set exit info in Eshell if the command is being piped elsewhere
Previously, the exit info in Eshell was that of the last command that
finished, rather than the last command in a pipeline.
* lisp/eshell/esh-cmd.el (eshell-exec-lisp)
(eshell-lisp-command): Check whether the command is being piped.
* lisp/eshell/esh-proc.el (eshell-gather-process-output): Record whether
the command is being piped...
(eshell-sentinel): ... and do the right thing with that info.
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Check the exit status to ensure
we don't report the first process's SIGPIPE exit.
(cherry picked from commit
b7893e73878df83043e05dc8cb811971c0e99f03)