CBD-816 Export apply_new_bucket_config_new_style.

It will be used for recovery. Additionally I made it return more
detailed error.

Change-Id: I4b0a502039c6e81e465035184f8c50876b10f5c6
Reviewed-on: http://review.couchbase.org/25239
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
CBD-816 Export ns_rebalancer:maybe_cleanup_old_buckets.

It will be used for recovery. I also refined the way it handles errors
so that it would be more convenient to use it outside rebalancer.

Change-Id: Ifaf1cbe7cfe08f1cde3fa1900c3b03f82cb5aa1c
Reviewed-on: http://review.couchbase.org/25240
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>