On the work distribution in quasi-static processes