Don't call ReleaseStringUTFChars() unless we need to.