PCBC-215: Check the HTTP status code

Change-Id: I295b9ed6e57406cc40d656879d364c450f385fd8
Reviewed-on: http://review.couchbase.org/25305
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>