Merge "Revert^2 "Fix race in CommitCodeInternal and cleanup""
am: 0e595d372a

Change-Id: I0d453139681d742ccbe611ed654799ece7d4a3d4