Fixes #1742.
Using linenoise avoids a license compatibility issue (#1356), is a lot smaller and doesn't pull in ncurses.