Grating polarizers in waveguide miter bends