Fix wait until Nailgun's API is ready

Change-Id: Ie3c68297029c21faba3b477973b74d1c15398bb0