Improve mw.getCurrentFrame handling

Two similar bugs are handled here:
* mw.getCurrentFrame() doesn't work when the module is loaded (only when
  a function is called), which breaks os.date and os.time at module
  scope since I59ad364d.
* mw.getCurrentFrame() gives access to frame args from inside
  mw.loadData, which allows for data leakage between #invokes.

Bug: 67498
Bug: 65687

(cherry picked from commit 85aca87e94cb46de9e3686c7540eca193637e374)
Conflicts:

	tests/engines/LuaCommon/CommonTest.php
Change-Id: I82dde43e2601b59c03c6ed4b9365829c40a953a5