Fix a couple bugs in processing cancellation requests during terminal input.
  - Make sure we can never inadvertently try to close the terminal
    file descriptors twice.
  - When TERMIOS is available, turn off line-based input so that control
    codes (including ^C) are processed immediately, not after a newline.

* subversion/libsvn_subr/prompt.c (terminal_handle_t): New member restore_state
   tells terminal_close and cleanup handlers if terminal state has changed.
  (terminal_handle_init): New; safe-state initializer for terminal_handle_t.
  (terminal_cleanup_handler): New parameter close_handles. Renamed parameter
   restore_echo_state to restore_state since it's not just about echo.
  (terminal_plain_cleanup, terminal_child_cleanup):
   Update calls to terminal_cleanup_handler.
  (terminal_close): Remove terminal pool celanup handlers and call
   terminal_cleanup_handler directly to avoid double-close on file handles.
  (terminal_open): Use terminal_handle_init to initialize the terminal struct.
   In TERMIOS mode, turn off signals and turn on character-based input.
  (terminal_getc): Special-case input processing in TERMIOS mode.
  (prompt): Check for cancellation after a character has been received.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1439093 13f79535-47bb-0310-9956-ffa450edef68