handle and log errors in settings module

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