zsh: properly deal with non-existent dirs when creating switchfuncs