Mechanism of strand exchange from RecA-DNA synaptic and D-loop structures