Cooperation can improve the resilience of common-pool resource systems against over-harvesting