Avoid dup'ing file descriptors when not necessary.
Do not send fd to the client if ops->get_fd() fails.

diff --git a/server/registry.c b/server/registry.c
index af7ba8a..4fa5a4e 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -1340,7 +1340,7 @@
     int fd;
 
     if (!(obj = get_handle_obj( current->process, handle, GENERIC_READ, NULL ))) return;
-    fd = obj->ops->get_fd( obj );
+    fd = dup(obj->ops->get_fd( obj ));
     release_object( obj );
     if (fd != -1)
     {
@@ -1435,7 +1435,7 @@
         return;
     }
     if (!(obj = get_handle_obj( current->process, handle, GENERIC_WRITE, NULL ))) return;
-    fd = obj->ops->get_fd( obj );
+    fd = dup(obj->ops->get_fd( obj ));
     release_object( obj );
     if (fd != -1)
     {