Use to_jstring() everywhere at the JNI layer

We have seen a ugly crash in `sort()` which might related to Russian letters (see issue #529). As @kspangsege mentioned recently, `to_jstring()` must be used when strings are returned from the core to the JVM.

@cmelchior @bmunkholm