Superharmonic instability, homoclinic torus bifurcation and water-wave breaking