Handle Esc in the release event, not the press event
Otherwise we exit in the press event, and the release event may get passed to whatever window was behind us.
Otherwise we exit in the press event, and the release event may get passed to whatever window was behind us.