Fix waitForFinishedWithEventLoop() causing a freeze in composer

Thanks Nyall for finding that out!