Retry commands if failed

Bug: 59213
Change-Id: I7e5990641ac8f29e40d571a581a04bfd916d5306