Solving the Bethe-Salpeter equation for the second-harmonic generation in Zn chalcogenides