Determination of the S-wave pi pi scattering lengths from a study of K+- -> pi+- pi0 pi0 decays