monitor: prevent monitor_state.data json file corruption
If the monitor is stopped while the file monitor_state.data
is being updated,
the file can be corrupted because it contains invalid Json.
If the monitor is stopped while the file monitor_state.data
is being updated,
the file can be corrupted because it contains invalid Json.