Add a workaround for unbalanced key events on macOS
This is an attempt to fix the modifiers bug on macOS without patching Qt.
The workaround is active only on macOS or on any system if KRITA_FIX_UNBALANCED_KEY_EVENTS
environment variable is active (though on other systems we have a proper fix inside Qt).
I cannot test on macOS myself, so please test and tell your opinion :)
Qt bug: https://bugreports.qt.io/browse/QTBUG-103868 BUG:454256
Edited by Dmitry Kazakov