Use separate lock in UserController

Introduced a new lock for synchronizing internal state - mLock.

This change improves locking by reducing the amount of contention on
ActivityManager lock. E.g. in user switching test executed 4 times, the
total time reported in dvm_lock_sample for locks owned by UserController
was reduced from 9200 to 2400 ms.

Test: UserControllerTest
Test: android.multiuser.UserLifecycleTests
Test: CtsMultiUserHostTestCases

Bug: 64165549
Change-Id: I907b22dcda806b4159c8afa4a7299e8e538ba721
10 files changed