labs: simplify wait_for_autofiles logic

Refactoring to make the control flow easier to understand.

Change-Id: Id38fd1c06ba51ec65577e7c6e7d7caf67acff666
Merge "labs: simplify wait_for_autofiles logic"