Fix race condition when updating sources

The current implementation has a potential race condition under the following scenario:

Task updater              Driver

                          acquire lock
                          process new sources
                          ...
                          process new sources in lock release code
add new source
fail to acquire lock
 (sources not processed)
                          release lock

This results in new sources not being processed and the query getting stuck
if the task updater never call update sources again and the driver becomes
blocked because data from all current exchanges are consumed