Bug 836930:
- Added strong reference to `document-shown` and remove it during the unload
- Added unit test for the `document-shown` scenarios with `forceGC`