Speed up ensure_parsed
Speed up ensure_parsed

Summary:
`ensure_parsed` makes sure that every file we're about to merge has been parsed into `ASTHeap`. For a full check, this means EVERY file. And we were doing this one by one on the master thread, which was taking around 45s. If we do this on worker threads, it will instead take 2s.

I did explore some other solutions:

* Keeping track in `Parser_heaps` which files are known but haven't been parsed yet due to saved state. This would add some more global state to the master process, so we'd need to be able to roll it back via a transaction.
* Keeping track in env which files haven't been parsed yet. This avoids global state but we have to make sure to update the env whenever a file is successfully parsed.

Reviewed By: panagosg7

Differential Revision: D9347529

fbshipit-source-id: 87298a16c3804527c5111f37a533b88b8fdf8842

jamesgpearce/flow,popham/flow,nmote/flow,jamesgpearce/flow,facebook/flow,AgentME/flow,jamesgpearce/flow,jamesgpearce/flow,samwgoldman/flow,AgentME/flow,facebook/flow,gabelevi/flow,popham/flow,samwgoldman/flow,facebook/flow,facebook/flow,gabelevi/flow,facebook/flow,facebook/flow,JonathanUsername/flow,gabelevi/flow,mroch/flow,nmote/flow,JonathanUsername/flow,nmote/flow,nmote/flow,samwgoldman/flow,popham/flow,gabelevi/flow,nmote/flow,JonathanUsername/flow,mroch/flow,nmote/flow,jamesgpearce/flow,mroch/flow,popham/flow,JonathanUsername/flow,mroch/flow,facebook/flow,popham/flow,gabelevi/flow,gabelevi/flow,jamesgpearce/flow,samwgoldman/flow,gabelevi/flow,samwgoldman/flow,JonathanUsername/flow,mroch/flow,mroch/flow,jamesgpearce/flow,AgentME/flow,mroch/flow,JonathanUsername/flow,popham/flow,samwgoldman/flow,popham/flow,AgentME/flow,AgentME/flow,JonathanUsername/flow,nmote/flow,samwgoldman/flow