util: UartUpdateTool retries Host/Dev sync up to three times
util: UartUpdateTool retries Host/Dev sync up to three times

This patch increases the number of device sync attempts from two to
three.
It is to be tolerant on the first command failure because of USB
DATA PID mismatch that could happen from USB reconnection.

BUG=b:135617689
BRANCH=none
TEST=Tested on Hatch and Kohaku, Octopus and Grunt.

  $ ./util/flash_ec --board hatch --image ${IMG}
  ...
  Performing a Host/Device synchronization check...
  Host/Device synchronization failed, error = 1.
  Writing [784] bytes in [4] packets
  ...
  INFO: Flashing done.
  INFO: Restoring servo settings...

The first attempt runs good.
Disconnect Suzy-Q cable, and reconnect it, and run it again:

  $ ./util/flash_ec --board hatch --image ${IMG}

Before this patch, it used to fail:
  ...
  Performing a Host/Device synchronization check...
  Host/Device synchronization failed, error = 2.
  Host/Device synchronization failed, error = 1.
  ERROR: Failed to load monitor binary.
  INFO: Restoring servo settings...

After this patch, it succeeds:
  ...
  Performing a Host/Device synchronization check...
  Host/Device synchronization failed, error = 2.
  Host/Device synchronization failed, error = 1.
  Writing [784] bytes in [4] packets
  ...
  INFO: Flashing done.
  INFO: Restoring servo settings...

Change-Id: Id8e7041a5cb08075129148ddba5e8cf12f3aae54
Signed-off-by: Namyoon Woo <e8732cefb861f07768f47df788a8e8eb75efc09a@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755182
Reviewed-by: Mary Ruthven <81380f3403fed74252e92df3ed012a1819ec6296@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec