regulators: Close devices when system powering off

Modify the Manager class to close all regulator devices when monitoring
is disabled.  Monitoring is normally disabled because the system is
being powered off.

Also add a closeDevices() method to the System class that closes all
devices in the system.

Tested:
  * Tested when monitoring was disabled.  Verified debug journal message
    stating devices were closed.
  * Tested multiple consecutive power on/off cycles to ensure device
    access remained functional.
  * Performed regression test on existing function.
  * Created and executed automated tests for System::closeDevices()

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I074190454c505116cccf1bc130a70205f34d0e26
diff --git a/phosphor-regulators/src/system.cpp b/phosphor-regulators/src/system.cpp
index 57df6ef..29dad5e 100644
--- a/phosphor-regulators/src/system.cpp
+++ b/phosphor-regulators/src/system.cpp
@@ -34,6 +34,15 @@
     }
 }
 
+void System::closeDevices()
+{
+    // Close devices in each chassis
+    for (std::unique_ptr<Chassis>& oneChassis : chassis)
+    {
+        oneChassis->closeDevices();
+    }
+}
+
 void System::configure()
 {
     // Configure devices in each chassis