Bug 975472 - fix crash in DOM error handler, r=dhylands