Fix emulated key show/hide timeout.

Keep track of the previous timeout event and cancel it if we already
dismissed the emulated keys, to avoid the case where the emulated keys
vanish immediately after opening them when used just beforehand.