lib/android: hacks to fix new_global_ref awaiting a fix for #845