A Homoclinic Route to Full Cooperation in Adaptive Social Networks