refactor ns_server metadata updates

Change-Id: Ifb45a4c487a8eb0a25985b62291ecbab1d294e77
Reviewed-on: http://review.couchbase.org/24373
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>