zsh: improve tmux detection in prompt
zsh: improve tmux detection in prompt

$TMUX won't be propagated to root (sudo) shells, so check $TERM (which
is propagated) instead.

Tweak surrounding code to work with the new conditions in place:

- tmux -> $ -> $$ -> $$$: works as expected
- tmux -> $ -> sudo (#) -> ##: works as expected
- $ -> $$ -> $$$: works as expected
- sudo (#) -> tmux (##): edge case

The only case where this doesn't work as we'd like is that last edge
case, but it is a relatively rare one (sudo-ing to root and *then*
starting a tmux session). I have a fix in mind for it but I am going to
put that in a separate commit to make it clear what's happening.

wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent,wincent/wincent