Clean up allocated data structures in JNI fixes hang in test cases.
Binary support for OSX added.