Photoproduction of charged pions on deuterium in the first resonance region