Fix race updating closure vars in ClosureExpression::inferTypes

Summary: When this code was written, there each ClosureExpression had
a unique m_func. Traits changed that, and now the m_func and m_vars
can be shared. Move the lock so the entire operation is guarded.

Reviewed By: @ottoni

Differential Revision: D1526701
Sanity check region descriptors

Summary: Before trying to translate a region, checks if it is well-formed, which entails the following properties:

 1) The region has at least one block.

 2) Each block in the region has a different id.

 3) All arcs involve blocks within the region.

 4) For each arc, the bytecode offset of the dst block must possibly follow the execution of the src block.

 5) Each block contains at most one successor corresponding to a given SrcKey.

 6) The region doesn't contains any loops, unless JitLoops is enabled.

 7) All blocks are reachable from the entry block.

Reviewed By: @alexmalyshev

Differential Revision: D1521900