Correctly construct ClosedChannelException via JNI