Fix race condition in cli_test.py

We weren't waiting for the build to finish, causing the rest of the test
to occasionally fail when looking for the image.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>