sensor-mon: Persist timer start times

It's possible that while a shutdown timer is running, this app or the
whole BMC may restart.  In that case, we want to restart the timer with
only the remaining time, assuming the alarm is still active.

To do this, create a new AlarmTimestamps class to hold any running timer
start times and persist these times using the cereal library.  If the
application is restarted with timestamps written out and the alarm is
initially active and power is on, then the shutdown timer will be
calculated to be:
    delay = shutdownDelay - (now - original time)

Note that cereal doesn't know how to handle the AlarmType or
ShutdownType types so they are converted to ints before writing.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If07abe91c0e6951fcd74bbc49eb511a38f7b4006
4 files changed