Fix failed builds being attempted twice.

Change-Id: Iaf4a7f53c8e5e44c554c194382b1959f43463e56