Domain Decomposition for Quasi-Periodic Scattering by Layered Media via Robust Boundary-Integral Equations at All Frequencies