Bug 839500 - close identity iframe when not in use

This commit is cherry-picked from my v1-train branch; It can be merged into master when [Bug 839500](https://bugzilla.mozilla.org/show_bug.cgi?id=839500) lands in m-c.