[stats.c] cleanup all our resources