Loop until ubus connection succeeds