Re-land fix for unload/beforeunload events, fixes https://github.com/Polymer/platform/issues/83
Merge pull request #499 from Polymer/polymer_issue_421_take2

Re-land fix for unload/beforeunload events