Tighten up locking in JNI controller (#6249)
Tighten up locking in JNI controller (#6249)

Some CHIP functions are being called without locks held, which can
result in races. Tighten up the locking by taking the stack lock at the
beginning of each JNI function and only unlocking it during callbacks
(Those were needed to avoid deadlocks in some re-entrant calls. Which
are another potential source of errors, but that hasn't been addressed
here).
nestlabs/connectedhomeip,nestlabs/connectedhomeip,nestlabs/connectedhomeip,nestlabs/connectedhomeip,project-chip/connectedhomeip,project-chip/connectedhomeip,project-chip/connectedhomeip,nestlabs/connectedhomeip,project-chip/connectedhomeip,project-chip/connectedhomeip,nestlabs/connectedhomeip,project-chip/connectedhomeip,nestlabs/connectedhomeip