Fix preexec and postexec conditions in zsh_hooks

$TERM in tty should either be 'fbterm' or 'linux' depending on if fbterm
is installed or not. Either case, we don't want the set_running_app() to
run there because it causes input to be printed to output.
Refactor login logic for fbterm support in tty
Use "case" testing for setting $TERM variable