Modularity of food-sharing networks minimises the risk for individual and group starvation in hunter-gatherer societies