Added waitForCompletion() method to block until download is complete

Signed-off-by: Maxime Petazzoni <mpetazzoni@turn.com>