Avoid a potentially invalid cast in WindowEventDispatcher::PreDispatchEvent
Avoid a potentially invalid cast in WindowEventDispatcher::PreDispatchEvent

If the window is destroyed during the mouse dispatch, target pointer be invalid
and reference an already freed memory. While keeping it and not accessing is
somewhat safe, especially, if the caller takes care of the rest,
doing an active static_cast could lead to undefined behavior.

In this case, the second static cast from target to Window* seems to be unnecessary,
since target variable does not change the value, and points to the same memory.

This issue was observed live, while running
WindowEventDispatcherTest.DeleteWindowDuringMouseMovedDispatch test
with Control Flow Integrity mode enabled. See
https://sites.google.com/a/chromium.org/dev/developers/testing/control-flow-integrity

BUG=chromium:512597,chromium:457523

Review URL: https://codereview.chromium.org/1246793004

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340212}

ltilve/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend