PEL: Fix memory leak in GetPEL D-Bus method

The GetPEL D-Bus method returns a file descriptor to the PEL data. While
it was closing the file descriptor so those didn't leak, it wasn't
calling fclose() after an fopen() which did leak about 300 bytes per
call, if I interpreted the valgrind output correctly.

Since all the code needs anyway is the file description, just use open()
instead of fopen().

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ia5f4d01c35ac0135a70aa30488fcf2666ca82dc5
diff --git a/extensions/openpower-pels/repository.cpp b/extensions/openpower-pels/repository.cpp
index 288d39a..e04b9a8 100644
--- a/extensions/openpower-pels/repository.cpp
+++ b/extensions/openpower-pels/repository.cpp
@@ -15,6 +15,7 @@
  */
 #include "repository.hpp"
 
+#include <fcntl.h>
 #include <sys/stat.h>
 
 #include <phosphor-logging/log.hpp>
@@ -289,9 +290,8 @@
     auto pel = findPEL(id);
     if (pel != _pelAttributes.end())
     {
-        FILE* fp = fopen(pel->second.path.c_str(), "rb");
-
-        if (fp == nullptr)
+        int fd = open(pel->second.path.c_str(), O_RDONLY | O_NONBLOCK);
+        if (fd == -1)
         {
             auto e = errno;
             log<level::ERR>("Unable to open PEL File", entry("ERRNO=%d", e),
@@ -301,8 +301,7 @@
 
         // Must leave the file open here.  It will be closed by sdbusplus
         // when it sends it back over D-Bus.
-
-        return fileno(fp);
+        return fd;
     }
     return std::nullopt;
 }