REPL/LineEdit to support "undo": part of #8447
The REPL now supports undo via Ctrl-/ or Ctrl-_.
This should very closely minic the behavior of other readline/emacs
shells, except it doesn't let the user goto a historical entry (A),
edit it, goto a different historical entry (B), return to the first
(A) and undo the edits.