Fix #1814: Dont set IRScope in StaticScope passed to BEGIN/END scopes

* BEGIN/END scopes use static scopes of their containers and don't
  get to define their own private variables.

* So, dont clobber IRScope in the shared StaticScope that is passed
  into constructors of the IRClosure IR-scopes.

* Fixes the test case in #1814.

* TODO:
  1. Cleanup the IRClosure constructor mess.
  2. Maybe create specialized scopes for BEGIN/END blocks.
  3. Merge IRStaticScope & StaticScope.
  4. Clean up how StaticScope is used in IRScope.
  5. Check whether it is possible to maintain a 1-1 mapping between
     IRScope and StaticScope.