Android: Fix crash in JSONGenerator