Merge "Refactor locking in input method framework"