Rework abort method to prevent race condition on main_failure_.