Avoid a descriptor leak in catalog loading code

File descriptors could be leaked in xmlLoadFileContent()
diff --git a/catalog.c b/catalog.c
index af84b7c..f33a0aa 100644
--- a/catalog.c
+++ b/catalog.c
@@ -997,18 +997,15 @@
     }
 #ifdef HAVE_STAT
     len = read(fd, content, size);
+    close(fd);
 #else
     len = fread(content, 1, size, fd);
+    fclose(fd);
 #endif
     if (len < 0) {
         xmlFree(content);
         return (NULL);
     }
-#ifdef HAVE_STAT
-    close(fd);
-#else
-    fclose(fd);
-#endif
     content[len] = 0;
 
     return(content);