Fix for client accessing a named pipe after the server closes it.

diff --git a/server/fd.c b/server/fd.c
index 7417dee..191d126 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -987,7 +987,7 @@
 
     if ((obj = get_handle_obj( process, handle, access, NULL )))
     {
-        if (!(fd = get_obj_fd( obj ))) set_error( STATUS_OBJECT_TYPE_MISMATCH );
+        fd = get_obj_fd( obj );
         release_object( obj );
     }
     return fd;
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 984c575..780fcc6 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -163,7 +163,9 @@
 static struct fd *pipe_user_get_fd( struct object *obj )
 {
     struct pipe_user *user = (struct pipe_user *)obj;
-    return (struct fd *)grab_object( user->fd );
+    if (user->fd) return (struct fd *)grab_object( user->fd );
+    set_error( STATUS_PIPE_DISCONNECTED );
+    return NULL;
 }
 
 static void pipe_user_destroy( struct object *obj)