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

Change-Id: If96567efcd76e6b5e56dad539b2ae5df635d3162