Add extra locking around packfile open
Add extra locking around packfile open

We were still seeing a few issues in threaded access to packs.
This adds extra locks around the opening of the mwindow to
avoid a different race.

sim0629/libgit2,falqas/libgit2,since2014/libgit2,spraints/libgit2,maxiaoqian/libgit2,Snazz2001/libgit2,whoisj/libgit2,amyvmiwei/libgit2,Corillian/libgit2,ardumont/libgit2,kissthink/libgit2,sygool/libgit2,kissthink/libgit2,KTXSoftware/libgit2,t0xicCode/libgit2,iankronquist/libgit2,mingyaaaa/libgit2,MrHacky/libgit2,since2014/libgit2,leoyanggit/libgit2,Tousiph/Demo1,linquize/libgit2,sim0629/libgit2,mhp/libgit2,Corillian/libgit2,zodiac/libgit2.js,KTXSoftware/libgit2,MrHacky/libgit2,sygool/libgit2,maxiaoqian/libgit2,Corillian/libgit2,mcanthony/libgit2,evhan/libgit2,amyvmiwei/libgit2,mrksrm/Mingijura,stewid/libgit2,magnus98/TEST,skabel/manguse,since2014/libgit2,chiayolin/libgit2,kissthink/libgit2,oaastest/libgit2,jflesch/libgit2-mariadb,spraints/libgit2,falqas/libgit2,Snazz2001/libgit2,Tousiph/Demo1,sim0629/libgit2,sygool/libgit2,dleehr/libgit2,stewid/libgit2,mhp/libgit2,joshtriplett/libgit2,yosefhackmon/libgit2,magnus98/TEST,mhp/libgit2,nokiddin/libgit2,iankronquist/libgit2,saurabhsuniljain/libgit2,mingyaaaa/libgit2,yongthecoder/libgit2,Corillian/libgit2,kissthink/libgit2,joshtriplett/libgit2,saurabhsuniljain/libgit2,zodiac/libgit2.js,raybrad/libit2,jeffhostetler/public_libgit2,claudelee/libgit2,maxiaoqian/libgit2,mhp/libgit2,amyvmiwei/libgit2,joshtriplett/libgit2,mingyaaaa/libgit2,iankronquist/libgit2,zodiac/libgit2.js,KTXSoftware/libgit2,whoisj/libgit2,kenprice/libgit2,swisspol/DEMO-libgit2,jflesch/libgit2-mariadb,mrksrm/Mingijura,maxiaoqian/libgit2,kenprice/libgit2,claudelee/libgit2,leoyanggit/libgit2,jflesch/libgit2-mariadb,spraints/libgit2,kenprice/libgit2,swisspol/DEMO-libgit2,kenprice/libgit2,sim0629/libgit2,jeffhostetler/public_libgit2,swisspol/DEMO-libgit2,mingyaaaa/libgit2,t0xicCode/libgit2,rcorre/libgit2,falqas/libgit2,Aorjoa/libgit2_maked_lib,t0xicCode/libgit2,claudelee/libgit2,skabel/manguse,stewid/libgit2,spraints/libgit2,MrHacky/libgit2,yongthecoder/libgit2,Tousiph/Demo1,chiayolin/libgit2,linquize/libgit2,skabel/manguse,dleehr/libgit2,Aorjoa/libgit2_maked_lib,maxiaoqian/libgit2,yongthecoder/libgit2,MrHacky/libgit2,saurabhsuniljain/libgit2,nokiddin/libgit2,whoisj/libgit2,mrksrm/Mingijura,swisspol/DEMO-libgit2,Aorjoa/libgit2_maked_lib,ardumont/libgit2,Aorjoa/libgit2_maked_lib,magnus98/TEST,skabel/manguse,oaastest/libgit2,leoyanggit/libgit2,linquize/libgit2,chiayolin/libgit2,yongthecoder/libgit2,KTXSoftware/libgit2,rcorre/libgit2,sygool/libgit2,iankronquist/libgit2,skabel/manguse,dleehr/libgit2,mingyaaaa/libgit2,Tousiph/Demo1,nokiddin/libgit2,since2014/libgit2,mcanthony/libgit2,evhan/libgit2,Tousiph/Demo1,chiayolin/libgit2,yosefhackmon/libgit2,MrHacky/libgit2,mrksrm/Mingijura,oaastest/libgit2,mcanthony/libgit2,whoisj/libgit2,kissthink/libgit2,yosefhackmon/libgit2,rcorre/libgit2,KTXSoftware/libgit2,mingyaaaa/libgit2,JIghtuse/libgit2,stewid/libgit2,raybrad/libit2,raybrad/libit2,sygool/libgit2,raybrad/libit2,magnus98/TEST,linquize/libgit2,zodiac/libgit2.js,yosefhackmon/libgit2,evhan/libgit2,maxiaoqian/libgit2,jeffhostetler/public_libgit2,JIghtuse/libgit2,oaastest/libgit2,whoisj/libgit2,yosefhackmon/libgit2,ardumont/libgit2,yongthecoder/libgit2,rcorre/libgit2,falqas/libgit2,kissthink/libgit2,Aorjoa/libgit2_maked_lib,Snazz2001/libgit2,saurabhsuniljain/libgit2,leoyanggit/libgit2,amyvmiwei/libgit2,joshtriplett/libgit2,claudelee/libgit2,JIghtuse/libgit2,whoisj/libgit2,falqas/libgit2,falqas/libgit2,Snazz2001/libgit2,nokiddin/libgit2,mhp/libgit2,linquize/libgit2,t0xicCode/libgit2,iankronquist/libgit2,spraints/libgit2,mrksrm/Mingijura,MrHacky/libgit2,chiayolin/libgit2,evhan/libgit2,magnus98/TEST,swisspol/DEMO-libgit2,stewid/libgit2,joshtriplett/libgit2,JIghtuse/libgit2,mcanthony/libgit2,rcorre/libgit2,Corillian/libgit2,spraints/libgit2,joshtriplett/libgit2,Snazz2001/libgit2,claudelee/libgit2,sim0629/libgit2,stewid/libgit2,rcorre/libgit2,jeffhostetler/public_libgit2,dleehr/libgit2,leoyanggit/libgit2,yosefhackmon/libgit2,ardumont/libgit2,magnus98/TEST,mhp/libgit2,ardumont/libgit2,Corillian/libgit2,chiayolin/libgit2,sygool/libgit2,sim0629/libgit2,mcanthony/libgit2,oaastest/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,JIghtuse/libgit2,claudelee/libgit2,t0xicCode/libgit2,dleehr/libgit2,saurabhsuniljain/libgit2,kenprice/libgit2,amyvmiwei/libgit2,Tousiph/Demo1,iankronquist/libgit2,since2014/libgit2,JIghtuse/libgit2,ardumont/libgit2,oaastest/libgit2,since2014/libgit2,linquize/libgit2,amyvmiwei/libgit2,mrksrm/Mingijura,t0xicCode/libgit2,zodiac/libgit2.js,nokiddin/libgit2,yongthecoder/libgit2,swisspol/DEMO-libgit2,kenprice/libgit2,nokiddin/libgit2,jeffhostetler/public_libgit2,jflesch/libgit2-mariadb,dleehr/libgit2,skabel/manguse,jflesch/libgit2-mariadb,KTXSoftware/libgit2,mcanthony/libgit2,jflesch/libgit2-mariadb,Snazz2001/libgit2,raybrad/libit2,leoyanggit/libgit2