Automated atomicity-violation fixing