Add mutex-based protection mechanism to the HFP JNI layer

The protection mechanism is needed to avoid a race condition during
graceful cleaning up of the Bluetooth Handsfree Interface when Bluetooth
is disabled, and native upcalls like connection_state_callback()

Bug: 62116636
Test: manual
Change-Id: I6be4c0bd996beca5252e881c55279ea4f7503e7b
(cherry picked from commit 273651938dbc9bab838945f1524fb588699419c7)
1 file changed