Merge "Revert "Fix race in CommitCodeInternal and cleanup""
am: 0d3f480343

Change-Id: I9cbd666398daee4c523c1d9cb853fb0c6516040a