add function that waits for local name

Change-Id: I9e817cc08be4e6010412d3c238f61e2ffac6e519
Reviewed-on: http://review.couchbase.org/42581
Tested-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>