Extract function to dump config cache to disk

Change-Id: Ie33bbd8dda5c85c401ca4883630a54d0aff9de82
Reviewed-on: http://review.couchbase.org/30316
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>