download.sh: fix update_or_clone function not switching to the right branch