[Extensions] Invalidate exposed functions when the extension module is destroyed

The crash identified back when doing our Chromium update could not be
reproduced. This commit also adds a test. Without the change, RP would
crash in the test. With the change, RP doesn't crash anymore.

TEST=XWalkExtensionsIFrameTest.KeepingReferenceToFunctionFromDestroyedIFrame
BUG=https://crosswalk-project.org/jira/browse/XWALK-184