Clear errno before reading/writing

Ensure the errno is cleared before accessing
the sysfs file, so exceptions thrown without
setting an errno can be recognized as such.

Without this, the errno could still be set to
a nonzero value from a previous operation, and
the error handling code would think it happened
on the current operation.  The difference being
if there is a nonzero errno a Read/WriteFailure
error will be logged, and if zero the exception
will be rethrown.

Change-Id: Ia958376ca80484d4d594872ab8ab0154d1b767ca
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/sysfs.cpp b/sysfs.cpp
index b0c5a6d..af5f86a 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -267,6 +267,7 @@
     {
         try
         {
+            errno = 0;
             if (!ifs.is_open())
                 ifs.open(fullPath);
             ifs.clear();
@@ -343,6 +344,7 @@
     {
         try
         {
+            errno = 0;
             if (!ofs.is_open())
                 ofs.open(fullPath);
             ofs.clear();