Delete JNI Object references created from arrays

JNI Objects are deleted automatically when the native function returns,
but for large arrays this can not be enough and lead to running out of
resources before the native function returns. Prevent this by deleting
the references as they are created and finished being used.

Bug: 80527811
Test: Try sending a Now Playing List with a large number of items
Change-Id: I34ac44cdafca5b3edade8992a856f2f2fc14f23d
1 file changed