Fix using caller-aware methods after clearCallingIdentity()

When we check Accessibility access, we would like to
throw the security exception if the caller is not from
system server. Unfortuantely we get the calling pid
after clearCallingIdentity. It ends up the result
is always own pid.
To fix it, we get the calling pid before clearCallingIdentity.

Bug: 189454345
Test: manually test
Change-Id: I1399998eac70c973bc27da431a8eee3b1f804453
2 files changed