Set Prolog flag 'tty_control' to 'true' when using pty
When 'sweeprolog-top-level-use-pty' is non-nil, let the Prolog
top-level thread know that it controls the tty. This affects some
aspects of the top-level interaction, namely in the presence of choice
points. A significant benefit is that Prolog ensures that the tty
does not echo input, so we can stop setting 'comint-process-echoes'
which had the adverse effect of blocking Emacs when output stalls on
non-echoing terminals.
* sweep.pl (sweep_top_level_client/3): Become
'sweep_top_level_client/4'. New argument says whether the top-level
controls the tty.
(sweep_top_level_pty_client/1,sweep_top_level_server_loop_/2): Adjust.
* sweeprolog.el (sweeprolog-top-level-buffer): Stop setting
'comint-process-echoes'.
(sweeprolog-top-level--post-self-insert-function): When using a tty,
send single character responses directly and assume that the top-level
echoes them back.