Always ensure the fd is closed
When passing the file descriptor from Java to Rust the opened file descriptor needs to be detached in java
OnionMasq.start(fd.detachFd(), preferenceHelper.getBridgeLines());
The corresponding Java Doc state that the native code becomes responsible to close them after usage.
Return the native fd int for this ParcelFileDescriptor and detach it from the object here. You are now responsible for closing the fd in native code
I think that is not happening in the error case, and tbh. I'm curious to learn how this works in the happy path as well. Not closing the fd properly can lead to memory leaks.