user-mgmt: sync ipmi user & channel conf file

ipmi_user.json file is stored in non-volatile memory, and it is
necessary to make sure that file is properly synced to the storage
device, to avoid any corruption issue related to power
loss. This fix makes sure that temporary file is fully synced with
storage device and then renamed, such that the file is either
in old state or in new updated state.
Same is also performed for channel configuration file too.

Tested:
1. Verified regular ipmi user list & channel works without
any issue
2. Verifid that any power loss, immediately, once the file
is written doesn't corrupt the entries.

Change-Id: I9ef84573947ab6f85f66530ac4a20e9eeaddf283
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
2 files changed