mouse: fix segfault when ending drag outside window

when ending a drag outside the window, x11 doesn't send the leave event
until after release, whereas cocoa sends it as soon as the mouse leaves.
cocoa: fix dragging outside of window