support FreeBSD's sha1(1) for integrity checks
support FreeBSD's sha1(1) for integrity checks

In the absense of shasum(1) (which on FreeBSD is provided by Perl,
from ports) nvm falls back to sha1sum(1) which does not exist on
FreeBSD.  But FreeBSD does have sha1(1) so look for sha1(1) and use
it if present.

As part of this change, refactor the execution of the checksum
program down into nvm_checksum and also clean up some special-casing
of empty dist checksums, which is already handled by nvm_checksum.

jbergstroem/nvm,elrasguno/nvm,ljharb/nvm,creationix/nvm,psychoss/nvm,Salahudeen/nvm,psychoss/nvm,icyflame/nvm,woss/nvm,lukechilds/nvm,thomasf/nvm,LeeLovCY/nvm,domenicosolazzo/nvm,youleiy/nvm,devedbox/nvm,lukechilds/nvm,vinaykaradia/clone-nvm,reybango/nvm,egilkh/nvm,CristianCantoro/nvm,NicCollins/nvm,elrasguno/nvm,parasaro92/nvm,joneit/nvm,evocateur/nvm,kumaria/nvm,wskplho/nvm,youleiy/nvm,tlevine/nvm,scq000/nvm,mmorejon/nvm,JasonChrYoung/nvm,woss/nvm,misterdjules/nvm,SampleLiao/nvm,gtdeng/nvm,williamboman/nvm,Kuzirashi/nvm,Ingelheim/nvm,kmctown/nvm,nontage24/nvm,nontage24/nvm,domenicosolazzo/nvm,chinazhaghai/nvm,bevacqua/nvm,Theodeus/nvm,michael-ni/nvm,icyflame/nvm,williamboman/nvm,hkdobrev/nvm,PeterDaveHello/nvm,hkdobrev/nvm,scq000/nvm,jbergstroem/nvm,PeterDaveHello/nvm,WY08271/nvm,tianzhihen/nvm,wahyutaufik/nvm,JanChw/nvm,parasaro92/nvm,CristianCantoro/nvm,wahyutaufik/nvm,JasonChrYoung/nvm,edwmurph/nvm,diegofcb10/nvm,egilkh/nvm,JanChw/nvm,Theodeus/nvm,greyhwndz/nvm,dfackler/nvm,reybango/nvm,jaawerth/nvm,chinazhaghai/nvm,Richardphp/nvm,SampleLiao/nvm,mmorejon/nvm,tlevine/nvm,pmq20/nvm,christophercaburog/nvm,mirydz/nvm,IonicaBizauKitchen/nvm,cnpm/nvm,tianzhihen/nvm,DigitallySeamless/nvm,PeterDaveHelloKitchen/nvm,IonicaBizauKitchen/nvm,bbuck/nvm,slariviere/nvm,edwmurph/nvm,diegofcb10/nvm,kmctown/nvm,cjac/nvm,pmq20/nvm,ljharb/nvm,greyhwndz/nvm,devedbox/nvm,jhliberty/nvm,modulexcite/nvm,LeeLovCY/nvm,misterdjules/nvm,Ingelheim/nvm,cnpm/nvm,gtdeng/nvm,PeterDaveHelloKitchen/nvm,cirosantilli/nvm,modulexcite/nvm,jaawerth/nvm,hanhailong/nvm,cirosantilli/nvm,sjfkai/nvm,dfackler/nvm,mirydz/nvm,Kuzirashi/nvm,kumaria/nvm,christophercaburog/nvm,owen-it/nvm,thomasf/nvm,fnogatz/swivm,bbuck/nvm,WY08271/nvm,Richardphp/nvm,hanhailong/nvm,owen-it/nvm,evocateur/nvm,cjac/nvm,Salahudeen/nvm,slariviere/nvm,vinaykaradia/clone-nvm,wskplho/nvm,michael-ni/nvm,creationix/nvm,bevacqua/nvm,joneit/nvm,jhliberty/nvm,DigitallySeamless/nvm