Fix race condition in Datasources

Sometimes update_from_datasource() can be called before
init() finishes.  This leads to errors.  This fix
adds a sleep loop at the start of update_from_datasource()
to wait until init() finishes.

Change-Id: I7ffe354421718964873b801448e70191e0fafbb3