Use a separate latch for osk dialog.

Fix #1701