Reset IME visible types only when losing control

This partially resets a change from [1], as we should only reset the
requested visible types for the IME when we are losing the control,
regardless of whether the IME window is currently available (signaled
by the leash being available).

  [1]: I2fb3bf1dc057f85a9f8ad0166ec25519aa004905

Bug: 328374719
Test: n/a
Change-Id: I83c24c7c05b828b26ef51b9ae2fbf69366a3b1dc
1 file changed