[Bug 229403] X needs to clear kbd status when handling events that stop event loop