Measurement of the B0 -> D*- Ds*+ and Ds+ -> phi pi branching fractions