Add timeout for statisticsCollector shutdown