Three fixes in update_history_times():
1. Wrap DB operations in try-catch — exception no longer skips the
snapshot restore, preventing permanent loss of accumulated counts
2. Treat get_history_times() -1 return (DB failure) as skip, not as
"record exists" → no more silent UPDATE on non-existent rows
3. Only call update_static and advance last_load_time_ on success,
so a failed persist retries on the next cycle instead of waiting
another rw_time_ minutes