Channel: Fix atomic lock issue for file copy

Atomic lock was missing in between volatile / non-volatile
channel configuration check and restore. This was causing
random failure when instances init channel management code.
Fixed the same, by having a lock for init channel.

Tested:
1. Verified that existing ipmitool commands still works
including user & channel commands
2. Verified that random failure doesn't happen.

Change-Id: I612917ea1a767e353d0b16b7dd9144e0e99d46e7
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 008ffd9..f2a6354 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -1341,6 +1341,9 @@
 
 void ChannelConfig::initChannelPersistData()
 {
+    boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
+        channelLock{*channelMutex};
+
     /* Always read the channel config */
     if (loadChannelConfig() != 0)
     {