SF: Generalize thread safety guards

Replace the guards with a uniform syntax that can be reused with
annotations other than mStateLock and SF_MAIN_THREAD.

Bug: 182939859
Test: Build
Change-Id: I03e6fe5d465111a5882d2fc1c09fe1dc9660aa07
9 files changed