Check indentation was successful before trying again

If for some reason the indentation fails (although it really
shouldn't), we don't want to get stuck in an infinite loop.

Bug: 58060
Change-Id: Icf74c42a224d949e51727fd93a84c0b3bfa3e8d5
Merge "Check indentation was successful before trying again"