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>
Merge pull request #501 from aanand/fix-build-error

Fix race condition in cli_test.py