Optical precursors in waveguide quantum electrodynamics