Fix event leakage between tests (bug 1071552)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1071552 for details.