fix MANPATH generation on FreeBSD
fix MANPATH generation on FreeBSD

On FreeBSD, if MANPATH is set it is used verbatim; configuration
files are completely ignored.  Therefore, setting MANPATH to (only)
the nvm man dir makes system man pages unreachable.

To get around this, before doing anything else to MANPATH, if it is
empty set it to the output of manpath(1).

One further complication: FreeBSD automatically adds a path to the
man pages path for each path in PATH that ends in "/bin", which
causes "~/.nvm/$VERSION/man" to be added.  This interferes with the
subsequent substitution so strip this from MANPATH before the
substitution.

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