Fix iterator check and return value
Fix iterator check and return value

There is a little cleanup necessary from PR #843.  Since the
new callbacks return `GIT_EUSER` we have to be a little careful
about return values when they are used internally to the library.

Also, callbacks should be checked for non-zero return values,
not just less than zero.

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