Resolvent expansions and continuity of the scattering matrix at embedded thresholds: the case of quantum waveguides