Triadic balance and closure as drivers of the evolution of cooperation