[zsh] Fix Terminal.app detection
[zsh] Update the terminal working dir in precmd

Makes sure that the terminal always knows the right cwd, even if no cd
was yet executed.