Merge change 25601 into eclair

* changes:
  Fix possible race condition when switching keyboards while there are pending messages.