Java array is updated after JNI call