Spectra of open waveguides in periodic media