Modify node traversal loop to avoid JS roots assertion. Fixes #2321.
auto merge of #2339 : glennw/servo/js-event-assert, r=jdm