10_terminal: Rework window title, tab title, and hardstatus handling
Now the result should be more consistent and useful:
- Apple Terminal.app: The current working directory is set for local
commands and removed for remote commands (mosh, ssh, telnet).
- The "window title" is set to "user@host", and the working directory is
added when not using Apple Terminal.app or a remote shell.
- The "icon title" (used for "tabulator titles" in most current terminal
emulators) and "hardstatus" (used by screen(1)) is set to the command
name only.