The function is meant to replace the duplicate pieces of code used in various
tests, the polling interval is unified to 20 seconds.
Cherry-picked from 836f0ddf
Related: rhbz#1769525
Previously it was looping, waiting for FINISHED|FAILED but was not
actually failing the test if the compose failed to build.
This adds a function to check the status of the compose and calls it
after each compose.
(cherry picked from commit d0e947fe3b)
Related: rhbz#1724073