Aligning Compound AI Systems via System-level DPO