Modal prefix history search.

Attempt to deal with down arrow better at end of history.
Refine prefix matching condition to consider mode changes as different.
Pass thru keypresses to parent mode.

Update lineedit test for new usage.
Cleanup some mess with types in LineEdit.jl
Use parent prompt indent.
Remove one unnecessary layer of anonymous functions.
Passthru escape sequences.
Preserve mode when editing history.
Drop unknown codes at REPL.

Better than producing an EOF error.
Keep cursor at prefix position.
Merge pull request #8879 from blakejohnson/modal-prefix

modal prefix searching in REPL