jni: GpsLocationProvider: Check for pending callbacks before waiting
jni: GpsLocationProvider: Check for pending callbacks before waiting

This change fixes a corner case where a callback may not get handled until
a second callback arrives.  This can happen because there is a significant
section of the wait_for_event function where the mutex is not locked, and
the sPendingCallbacks member could be updated.  We now check to see if
there is a pending callback to handle before we wait for another callback.

Change-Id: I20cfae1e780944bb74133940dda032efc4c55540
Signed-off-by: Fred Fettinger <16080796781b912425529708c8c3f6c18b322633@motorola.com>
Signed-off-by: Jared Suttles <600f23920b033269d65d7a4c96dc45eae410295e@motorola.com>
Signed-off-by: Mike Lockwood <368d0007e4626f70737d16df5e49ed8806b98c3f@android.com>

xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base