Call dispatch:beforeException on exceptions in event handlers

If an event handler throws an exception, call dispatch:beforeException
and exit the dispatch loop as if the handler returned false.

Fix #1763
Updated CHANGELOG
Test case for #1763
Merge pull request #1799 from sjinks/issue-1763

Call dispatch:beforeException on exceptions in event handlers