sync: Fix semaphore release bug that causes thread 'leaks'
sync: Fix semaphore release bug that causes thread 'leaks'

When repo syncs a manifest that utilizes multiple branches
in the same project, then the sync will use an extra
thread for each "duplicate".  For example, if
the manifest includes the project "foo" and "bar"
twice, then "repo sync -jN" will fetch with N+2 threads.

This is caused by _FetchHelper() releasing the thread semaphore
object each time it's called, even though _FetchProjectList()
may call this function multiple times within the scope of a
single thread.

Fix by moving the thread semaphore release to
_FetchProjectList(), which is only called once per thread
instance.

Change-Id: I1da78b145e09524d40457db5ca5c37d315432bd8

lewixliu/git-repo,wavecomp/git-repo,couchbasedeps/git-repo,lewixliu/git-repo,aosp-mirror/tools_repo,wavecomp/git-repo,dodocat/git-repo,aosp-mirror/tools_repo,nuclearmistake/repo,frogbywyplay/git-repo,gabbayo/git-repo,qioixiy/git-repo,11NJ/git-repo,mer-tools/git-repo,TheQtCompany/git-repo,mer-tools/git-repo,qioixiy/git-repo,nuclearmistake/repo,GerritCodeReview/git-repo,lipro-yocto/git-repo,dodocat/git-repo,frogbywyplay/git-repo,11NJ/git-repo,chenzilin/git-repo,TheQtCompany/git-repo,gabbayo/git-repo,GerritCodeReview/git-repo,chenzilin/git-repo,couchbasedeps/git-repo,codetutil/git-repo,codetutil/git-repo,lipro-yocto/git-repo