Ensure the window that got a key down also gets the corresponding key up
Otherwise it will be left in a inconsistent state (with a pressed key hanging around).
QQuickWindow's input dispatching doesn't guarantee that for its QQuickItem. So we have to do it ourselves.
This can happen when qml active focus changes in response to a key press. Eg: client creates a child window in response to a Ctrl+O. By the time the user releases the Ctrl, active focus will already be in the child window, so the child window will get the release event instead of the top-level one. (LP: #1671072)