Synchronizing native threads with conditional variables at Android NDK