Rethrow erors in events

Instead of manually calling window.onerror, rethrow the first error
at the end of the dispatch. This way window.onerror gets all the
expected arguments which is important for error reporters.

Fixes #408
Merge pull request #413 from arv/error-in-events

Rethrow erors in events