Guarantee add/remove permission order

Two threads add permission and remove permission
at the same time without order gurantee. It causes that
the test encounters security exception. Introducing a new
wait-lock can solve this problem.

Bug: 143736495
Test: manual, ran the test 10 times and it passed 10 times
Change-Id: Ib07d7ea0297331348f46f2059819cd6381453538
1 file changed