Synthesis of saturated and unsaturated dithioesters