fix detecting zsh version that supports chpwd_functions, fix #2515