fix the win_event_handler

Don't reference win after dispatching mouse event. Because the child
widget might destory the window.

Reported-by: softwind on the forum