add chpwd_functions handling for bash and old zsh, fix #2819
do not redefine __zsh_like_cd when already available, update #2819
more precise implementation of chpwd and chpwd_functions from Zsh, update #2819
always define __zsh_like_cd, there is no sense in forbiding an updated version to be loaded, update #2819