CachingBuildEngine: fix event ordering
CachingBuildEngine: fix event ordering

Summary:Previuosly, the build engine would nest build event scopes inside of each other
via setting up callbacks.  This worked most of the time, but there was no guarantee
that one of the inner futures/callables would start before the outer one finished.

Test Plan:Ran the caching build engine tests in a tight loops for 10s of minutes.  Previously,
this easily repro'd ordering issues, but didn't with this fix.

Reviewed By: k21

fb-gh-sync-id: 62652ec
fbshipit-source-id: 62652ec

justinmuller/buck,clonetwin26/buck,zhan-xiong/buck,brettwooldridge/buck,justinmuller/buck,bocon13/buck,dsyang/buck,rmaz/buck,illicitonion/buck,nguyentruongtho/buck,Dominator008/buck,davido/buck,OkBuilds/buck,JoelMarcey/buck,zpao/buck,daedric/buck,ilya-klyuchnikov/buck,daedric/buck,clonetwin26/buck,LegNeato/buck,OkBuilds/buck,clonetwin26/buck,shybovycha/buck,romanoid/buck,sdwilsh/buck,facebook/buck,justinmuller/buck,rmaz/buck,brettwooldridge/buck,Dominator008/buck,zhan-xiong/buck,grumpyjames/buck,brettwooldridge/buck,illicitonion/buck,Addepar/buck,romanoid/buck,raviagarwal7/buck,sdwilsh/buck,k21/buck,ilya-klyuchnikov/buck,robbertvanginkel/buck,darkforestzero/buck,janicduplessis/buck,janicduplessis/buck,janicduplessis/buck,JoelMarcey/buck,clonetwin26/buck,nguyentruongtho/buck,brettwooldridge/buck,rmaz/buck,robbertvanginkel/buck,OkBuilds/buck,SeleniumHQ/buck,kageiit/buck,justinmuller/buck,vschs007/buck,kageiit/buck,davido/buck,daedric/buck,rmaz/buck,grumpyjames/buck,zhan-xiong/buck,Dominator008/buck,illicitonion/buck,sdwilsh/buck,clonetwin26/buck,marcinkwiatkowski/buck,Addepar/buck,SeleniumHQ/buck,OkBuilds/buck,vschs007/buck,shs96c/buck,JoelMarcey/buck,Addepar/buck,darkforestzero/buck,sdwilsh/buck,darkforestzero/buck,vschs007/buck,janicduplessis/buck,clonetwin26/buck,romanoid/buck,Addepar/buck,grumpyjames/buck,LegNeato/buck,davido/buck,facebook/buck,davido/buck,ilya-klyuchnikov/buck,dsyang/buck,illicitonion/buck,rmaz/buck,robbertvanginkel/buck,SeleniumHQ/buck,davido/buck,janicduplessis/buck,daedric/buck,romanoid/buck,Dominator008/buck,OkBuilds/buck,brettwooldridge/buck,shs96c/buck,marcinkwiatkowski/buck,bocon13/buck,clonetwin26/buck,ilya-klyuchnikov/buck,clonetwin26/buck,robbertvanginkel/buck,justinmuller/buck,daedric/buck,shybovycha/buck,sdwilsh/buck,robbertvanginkel/buck,SeleniumHQ/buck,grumpyjames/buck,dsyang/buck,vschs007/buck,marcinkwiatkowski/buck,bocon13/buck,clonetwin26/buck,marcinkwiatkowski/buck,justinmuller/buck,zhan-xiong/buck,shybovycha/buck,shybovycha/buck,LegNeato/buck,robbertvanginkel/buck,clonetwin26/buck,rmaz/buck,SeleniumHQ/buck,illicitonion/buck,kageiit/buck,JoelMarcey/buck,JoelMarcey/buck,brettwooldridge/buck,sdwilsh/buck,janicduplessis/buck,k21/buck,ilya-klyuchnikov/buck,davido/buck,facebook/buck,vschs007/buck,romanoid/buck,nguyentruongtho/buck,darkforestzero/buck,Dominator008/buck,bocon13/buck,dsyang/buck,ilya-klyuchnikov/buck,ilya-klyuchnikov/buck,SeleniumHQ/buck,dsyang/buck,SeleniumHQ/buck,bocon13/buck,JoelMarcey/buck,Dominator008/buck,justinmuller/buck,Dominator008/buck,illicitonion/buck,vschs007/buck,k21/buck,marcinkwiatkowski/buck,janicduplessis/buck,shybovycha/buck,davido/buck,LegNeato/buck,davido/buck,robbertvanginkel/buck,Addepar/buck,daedric/buck,LegNeato/buck,kageiit/buck,dsyang/buck,romanoid/buck,illicitonion/buck,robbertvanginkel/buck,janicduplessis/buck,k21/buck,daedric/buck,romanoid/buck,darkforestzero/buck,grumpyjames/buck,SeleniumHQ/buck,k21/buck,bocon13/buck,zhan-xiong/buck,shybovycha/buck,vschs007/buck,shybovycha/buck,Addepar/buck,davido/buck,romanoid/buck,zhan-xiong/buck,k21/buck,facebook/buck,Addepar/buck,robbertvanginkel/buck,zpao/buck,raviagarwal7/buck,JoelMarcey/buck,LegNeato/buck,sdwilsh/buck,zhan-xiong/buck,justinmuller/buck,shybovycha/buck,daedric/buck,grumpyjames/buck,zhan-xiong/buck,k21/buck,kageiit/buck,rmaz/buck,JoelMarcey/buck,k21/buck,illicitonion/buck,brettwooldridge/buck,zpao/buck,robbertvanginkel/buck,illicitonion/buck,marcinkwiatkowski/buck,kageiit/buck,JoelMarcey/buck,SeleniumHQ/buck,Dominator008/buck,daedric/buck,raviagarwal7/buck,vschs007/buck,LegNeato/buck,davido/buck,Addepar/buck,shybovycha/buck,ilya-klyuchnikov/buck,raviagarwal7/buck,darkforestzero/buck,dsyang/buck,SeleniumHQ/buck,shs96c/buck,darkforestzero/buck,bocon13/buck,zhan-xiong/buck,JoelMarcey/buck,OkBuilds/buck,k21/buck,k21/buck,rmaz/buck,marcinkwiatkowski/buck,daedric/buck,illicitonion/buck,facebook/buck,romanoid/buck,darkforestzero/buck,OkBuilds/buck,Addepar/buck,ilya-klyuchnikov/buck,grumpyjames/buck,zhan-xiong/buck,sdwilsh/buck,marcinkwiatkowski/buck,k21/buck,robbertvanginkel/buck,zpao/buck,robbertvanginkel/buck,shs96c/buck,brettwooldridge/buck,romanoid/buck,Addepar/buck,grumpyjames/buck,raviagarwal7/buck,dsyang/buck,Addepar/buck,illicitonion/buck,OkBuilds/buck,facebook/buck,romanoid/buck,brettwooldridge/buck,vschs007/buck,marcinkwiatkowski/buck,daedric/buck,janicduplessis/buck,illicitonion/buck,daedric/buck,darkforestzero/buck,JoelMarcey/buck,OkBuilds/buck,raviagarwal7/buck,justinmuller/buck,dsyang/buck,raviagarwal7/buck,davido/buck,shs96c/buck,darkforestzero/buck,Dominator008/buck,justinmuller/buck,clonetwin26/buck,dsyang/buck,robbertvanginkel/buck,k21/buck,vschs007/buck,grumpyjames/buck,LegNeato/buck,grumpyjames/buck,darkforestzero/buck,SeleniumHQ/buck,ilya-klyuchnikov/buck,sdwilsh/buck,shs96c/buck,bocon13/buck,marcinkwiatkowski/buck,brettwooldridge/buck,marcinkwiatkowski/buck,ilya-klyuchnikov/buck,dsyang/buck,Dominator008/buck,vschs007/buck,bocon13/buck,shs96c/buck,grumpyjames/buck,raviagarwal7/buck,brettwooldridge/buck,sdwilsh/buck,romanoid/buck,brettwooldridge/buck,nguyentruongtho/buck,k21/buck,sdwilsh/buck,janicduplessis/buck,brettwooldridge/buck,shs96c/buck,Addepar/buck,shybovycha/buck,ilya-klyuchnikov/buck,rmaz/buck,dsyang/buck,OkBuilds/buck,shybovycha/buck,rmaz/buck,shs96c/buck,raviagarwal7/buck,darkforestzero/buck,raviagarwal7/buck,justinmuller/buck,JoelMarcey/buck,LegNeato/buck,zpao/buck,janicduplessis/buck,zpao/buck,zpao/buck,davido/buck,illicitonion/buck,nguyentruongtho/buck,davido/buck,LegNeato/buck,justinmuller/buck,vschs007/buck,Dominator008/buck,SeleniumHQ/buck,shybovycha/buck,OkBuilds/buck,rmaz/buck,shs96c/buck,OkBuilds/buck,ilya-klyuchnikov/buck,marcinkwiatkowski/buck,darkforestzero/buck,shs96c/buck,vschs007/buck,shs96c/buck,janicduplessis/buck,dsyang/buck,shs96c/buck,clonetwin26/buck,Addepar/buck,nguyentruongtho/buck,Dominator008/buck,clonetwin26/buck,sdwilsh/buck,rmaz/buck,LegNeato/buck,zhan-xiong/buck,bocon13/buck,LegNeato/buck,zhan-xiong/buck,zhan-xiong/buck,SeleniumHQ/buck,raviagarwal7/buck,nguyentruongtho/buck,facebook/buck,justinmuller/buck,bocon13/buck,daedric/buck,OkBuilds/buck,LegNeato/buck,grumpyjames/buck,raviagarwal7/buck,shybovycha/buck,rmaz/buck,sdwilsh/buck,bocon13/buck,marcinkwiatkowski/buck,raviagarwal7/buck,JoelMarcey/buck,kageiit/buck,romanoid/buck