[IR] Fixed crasher in dry runs (ex: ast script)
[IR] Bug fix in StoreLocalVar analysis pass

* For closures, this pass was attempting to store dirty local variables
  in a global ensure block to make sure that on exception exits, all
  dirty local vars are spilled to the binding. However, it was missing
  a check to verify if the local var was truly local to the closure and
  hence might not have been loaded on entry. If not loaded on entry,
  the JIT will not be able to generate valid bytecode for it since
  it would be misisng defs on some of the paths into the global ensure block.

  As it turns out, for all other exit blocks, this pass was correctly
  checking if the closure local var actually needed storing. But, this
  check was missing for the global ensure block.

  Fixed the problem by refactoring some code and reusing it for
  exit blocks as well as the global ensure block.

* For this snippet:

     def foo; yield; end; foo { a = 'bar'; puts a; }

  the generated stores are now correct.