Corrected segfault when using unwriteable cache directory.

We were not exiting the control flow properly for a
certain type of error.

Change-Id: I66775e0d0cd10ec968dbc0f6a6fc94f943d9ee0e
Reviewed-on: http://review.couchbase.org/34644
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>