Adaptive decision-making on stocking rates improves the resilience of a livestock system exposed to climate shocks