Free memory in JNI program binaries function