when idle do a checkpoint only if there were changes, or more than IDLE_RESTART has passed
fix build on freebsd