[RocksJava] Cleanup allocation code in JNI part

Allocation code within RocksJNI was not that readable and error prone. There were also explicit dereferencing calls missing.