Fix isDefaultPrevented for delegated events

The fix is borrowed from jQuery codebase: https://github.com/jquery/jquery/blob/master/src/event.js#L634