Better behavior when mouse leaving draggable element

I didn't like that the dragging would stop right when you mouseleave the
draggable element. It should only stop dragging when you mouseup or
leave the window, so bind the event to mouseup, touchend, and mouseleave
events on `window` instead.