Restructure mouse capture to avoid recapture asserts

Merged mitxela requested to merge mitxela/kicad:fix-mouse-asserts into master

Prevent capturing the mouse when it's already captured. Fixes #7194 (closed) hopefully.

Also put the windows specific mouse capture stuff into ifdefs since it was causing problems on linux, fixes #7208 (closed)

Edited by mitxela