[hack] Simplify try-catch case in GetLocals
[hack] Simplify try-catch case in GetLocals

Summary: We don't need to collect the locals for terminal catch blocks.
Previously, we were collecting the locals and throwing them away right
after finding out their blocks were terminal; this diff switches the
order and filters those blocks out first before collecting the locals.

Noticed this while converting naming/ to use Core, which doesn't expose
fold_right2 in Core_list.

Reviewed By: @dabek

Differential Revision: D2303722

paulshen/flow,CJstar/flow,facebook/flow,paulshen/flow,JohnyDays/flow,rafaelstz/flow,samwgoldman/flow,ylu1317/flow,gabelevi/flow,samwgoldman/flow,chenglou/flow,asivitz/flow,paulshen/flow,gabelevi/flow,Wanderfalke/flow,jeffmo/flow,nmote/flow,jdelStrother/flow,gabelevi/flow,ForbesLindesay/flow,paulshen/flow,CJstar/flow,dv/flow,jamesgpearce/flow,danvk/flow,danvk/flow,siddhartharay007/flow,ylu1317/flow,AprilArcus/flow,JeckoHeroOrg/flow,MichaelDeBoey/flow,chenglou/flow,Eyyub/flow,MichaelDeBoey/flow,nmote/flow,popham/flow,fletcherw/flow,Wanderfalke/flow,jeffmo/flow,cesarandreu/flow,danvk/flow,jeffmo/flow,AgentME/flow,jdelStrother/flow,samwgoldman/flow,JeckoHeroOrg/flow,lyip1992/flow,darioajr/flow,JonathanUsername/flow,facebook/flow,ForbesLindesay/flow,AgentME/flow,JonathanUsername/flow,graue/flow,fletcherw/flow,jamesgpearce/flow,gabelevi/flow,CJstar/flow,shiftcars/flow,mcanthony/flow-type,mcanthony/flow-type,jgrund/flow,cesarandreu/flow,ForbesLindesay/flow,TiddoLangerak/flow,Fresheyeball/flow,Drooids/flow,Drooids/flow,Eyyub/flow,AprilArcus/flow,gabelevi/flow,Fresheyeball/flow,graue/flow,popham/flow,JonathanUsername/flow,asivitz/flow,jeffutter/flow,chenglou/flow,ianobermiller/flow,claudiopro/flow,darioajr/flow,JohnyDays/flow,jamesgpearce/flow,jamesgpearce/flow,jgrund/flow,d14b3l/flow,Eyyub/flow,jeffmo/flow,Wanderfalke/flow,samwgoldman/flow,gabro/flow,shiftcars/flow,jdelStrother/flow,jeffmo/flow,fletcherw/flow,AprilArcus/flow,rafaelstz/flow,mroch/flow,jamesgpearce/flow,asivitz/flow,ianobermiller/flow,shiftcars/flow,claudiopro/flow,TiddoLangerak/flow,mroch/flow,matklad/flow,Drooids/flow,facebook/flow,jgrund/flow,d14b3l/flow,cesarandreu/flow,siddhartharay007/flow,MichaelDeBoey/flow,asivitz/flow,rafaelstz/flow,darioajr/flow,nmote/flow,fletcherw/flow,popham/flow,OCamlPro/flow,facebook/flow,gabelevi/flow,mcanthony/flow-type,jeffutter/flow,jgrund/flow,JeckoHeroOrg/flow,fletcherw/flow,Fresheyeball/flow,gabro/flow,mroch/flow,JohnyDays/flow,dv/flow,JeckoHeroOrg/flow,siddhartharay007/flow,facebook/flow,lyip1992/flow,chenglou/flow,lyip1992/flow,JonathanUsername/flow,graue/flow,AgentME/flow,gabro/flow,cesarandreu/flow,rafaelstz/flow,jdelStrother/flow,JohnyDays/flow,danvk/flow,JeckoHeroOrg/flow,OCamlPro/flow,jamesgpearce/flow,jeffmo/flow,Drooids/flow,JonathanUsername/flow,ianobermiller/flow,gabelevi/flow,d14b3l/flow,mcanthony/flow-type,mroch/flow,ianobermiller/flow,gabro/flow,KevinTCoughlin/flow,ylu1317/flow,d14b3l/flow,jamesgpearce/flow,popham/flow,matklad/flow,facebook/flow,JonathanUsername/flow,jeffutter/flow,KevinTCoughlin/flow,matklad/flow,siddhartharay007/flow,gabro/flow,mroch/flow,graue/flow,gabro/flow,d14b3l/flow,MichaelDeBoey/flow,Wanderfalke/flow,jdelStrother/flow,JonathanUsername/flow,jgrund/flow,AprilArcus/flow,samwgoldman/flow,dv/flow,Eyyub/flow,jeffutter/flow,CJstar/flow,matklad/flow,mroch/flow,AgentME/flow,AgentME/flow,popham/flow,shiftcars/flow,OCamlPro/flow,ForbesLindesay/flow,jdelStrother/flow,shiftcars/flow,nmote/flow,samwgoldman/flow,nmote/flow,KevinTCoughlin/flow,TiddoLangerak/flow,AprilArcus/flow,claudiopro/flow,claudiopro/flow,OCamlPro/flow,fletcherw/flow,jgrund/flow,popham/flow,popham/flow,ylu1317/flow,nmote/flow,graue/flow,TiddoLangerak/flow,KevinTCoughlin/flow,chenglou/flow,dv/flow,lyip1992/flow,TiddoLangerak/flow,mroch/flow,darioajr/flow,AprilArcus/flow,d14b3l/flow,claudiopro/flow,nmote/flow,MichaelDeBoey/flow,rafaelstz/flow,ForbesLindesay/flow,Fresheyeball/flow,matklad/flow,ylu1317/flow,graue/flow,chenglou/flow,facebook/flow,samwgoldman/flow,ForbesLindesay/flow,shiftcars/flow