[Win32] Fix spurious mouse enter and leave messages
Mouse tracking and mouse capture didn't work well together. Mouse capture was
also buggy in that it could release capture prematurely.
Mouse capture is now counted and tracked better, multiple requests to set
capture will only call SetCapture once. ReleaseCapture will only be called once
the same number of releases have been made as sets.
MW_MOUSELEAVE messages are now ignored if the mouse is captured.
Mouse tracking is renabled when mouse capture is released.
While the mouse is captured enter and leave events are genereated based on
tracking of the mouse inside MouseMove.
Fixes #301