Is this class AB design OK? I get distortion at the output
There is no DC feedback in this amplifier at all so the LF347 will hit the end stops and distortion will prevail: -

 

Where did you get this crappy design from? Also, why are you wanting to use a class AB amplifier to charge capacitors? Why not just use a MOSFET switch?