ANDROID: Delay deleting a local ref until it's no longer used

Should fix bug #6741
Merge https://github.com/scummvm/scummvm