Fix going into infinite loop in read_header_loose()
Fix going into infinite loop in read_header_loose()

read_header_loose causes infinite loop on this file:
$ cat ../libcppgit/bin/sample-repo/test_mailbox/.git/objects/8f/e274605cbc740a2a957f44b2722a8a73915a09 | base64
eAErKUpNVTAzYzA0MDAzMVHISUxKzSlmWLgkuyN5+rxr6juMPR2EmN8s7Vl9D6oiN7UkkcHJdLbl
7Z3N/oxfE0W8wrSbuFRkAwDFfBn1

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