High-Q Photonic Flat-Band Resonances for Enhancing Third Harmonic Generation in All-Dielectric Metasurfaces