Consider this driver for one of the two legs. When the NMOS has a negative Vds, the amp turns on the NMOS gate.
Here's the thing here. Look at the previous circuit and your fixed drivers. OK, when the generator voltage is +1v, do you WANT to turn on the MOSFET pair to connect it to the 5v rail? No, because the 5V will drive the generator like a motor because MOSFETs, unlike diodes, are bidirectional!
You want to turn on the MOSFET only when the generator voltage is greater than the battery voltage. This driver will do that by turning on the transistor only when its voltage is in a particular direction.
This will also avoid all issues with short circuiting the leg. There is a wide span where the generator voltage is not above +5v nor below -5v so neither side will be turned on.
In truth, this circuit is flawed. Many op-amps do not have rail-to-rail inputs and outputs. If the output capability's dropout between the higest output it can give and Vdd is less than Vth of the PMOS, you're good. Now the problem here is the inputs are in fact a few mV beyond the rails and very few op amps handle beyond the rails. Hopefully this will still be tolerable, but I'm just not sure what any given part would do.
Next flaw, the gain may be too high and oscillation is possible so some feedback may be necessary.
Now what's "V+" and "V-"? Well, due to inherent offset errors in the amps, the V+ cannot be 5v. If the op amp has a 4mV offset error, the V+ needs to be like 5.05v and the V- is -0.05v. Otherwise the op amp could turn the NMOS on hard, Vds=1mV, then the generator voltage drops below 5v and it needs to turn off to avoid feeding power back into the gen or worse stay on when the gen voltage is reversed. Well, with a 4mV offset error a 1mV differential signal will be read as 3mV and amplified 10,000 so the output to the gate remains at the +5v rail and the state will never be released, it's a latch. With a -0.05 Vref- and proper gain to prevent oscillation, the Vds will go no lower than -0.05 and once it biases the other way the amp will be able to read it and turn off the transistor.