Instead of sleeping use the newly introduced timeout argument. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>