fix handling of 404 errors

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