Add following functions to handle input from a thread that uses standard
input.
tty_inkey() waits for a key to be pressed for a specified amount of
time, and then returns the pressed string.
tty_simple_readln() reads user input until Enter is pressed.
It supports Backspace key.
tty_subcmd_readln() reads user input until Enter is pressed.
It supports line editing (cursor keys, Backspace) and command history.
The script REPL history buffer is now a dedicated history buffer instead
of the subcommand history buffer. REPL prompt changes from ">>" to "->".
Reduced the history buffer size from 1000 lines to 500 lines.