You need to ReleaseByteArrayElements as well: (and not delete)
http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
GetArrayElements Routines
NativeType *GetArrayElements(JNIEnv *env, ArrayType array, jboolean *isCopy);
A family of functions that returns the body of the primitive array. The result is valid until the corresponding ReleaseArrayElements() function is called. Since the returned array may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until ReleaseArrayElements() is called.
See the bold part.