add chpwd_functions handling for bash and old zsh, fix #2819