dup file descriptor in jni code to avoid closing the file descriptor in Java side while jni code still use it.