DiCA: A Hardware-Software Co-Design for Differential Checkpointing in Intermittently Powered Devices