Don't needlessly allocate empty counter_updates data in stats_flush()
Add signal handler to clean up temporary files at unexpected program exit
Clean up stale files in internal tempdir once an hour
Fix clang build warning "shift count >= width of type"