Mouse: Only detect out of document mouseups after a mousemove

This prevents the firing of mouseup in the case of IE<9, which will
fire a mousemove event if content is placed under the cursor on
mousedown.

Fixes #7778