Firestore: Fix global refs exhaustion issue in Android by dconeybe · Pull Request #1364 · firebase/firebase-cpp-sdk

Properly fix the the global refs exhaustion issue tracked by firebase/firebase-unity-sdk#569, and reported in firebase/quickstart-unity#1303 and firebase/quickstart-unity#1193 (comment) (Googlers see b/251869890 for more details). Part 1, a partial mitigation, was #1111.

This PR supersedes, and builds upon the work done by @cherylEnkidu in, #1176.

Googlers see go/firestore-cpp-sdk-android-global-ref-exhaustion-bug and b/251869890 for more information.