I'm attaching a simple application that may be used to observe the problem. The application creates a window and waits for WM_KEYDOWN message. It deadlocks without the patch. Unfortunately there's no way of testing it without the ability to generate non-injected hardware messages. I can add an interactive test if it's preferred.
Thanks, Piotr