Refactor command line IME tracing

This change refactors the command handling for enabling or disabling IME
tracing. The change also adds synchronization checks for accessing
clients.

Bug: 154348613
Test: start IME tracing by calling "adb shell ime tracing start"
      end IME tracing by calling "adb shell ime tracing stop"
      pull traces in "/data/misc/wmtrace/ime_trace_*"
Change-Id: I66d7ba09508f4a19eaf6c1f3d0ce03daf84d7421
1 file changed