GOCBC-292: Check for malformed packets before reading.
GOCBC-292: Check for malformed packets before reading.

Motivation
----------
There have been a few instances of the SDK encountering a
packet which appears to be malformed, causing it to crash.
Ideally, the SDK should be verifying the contents of the
packets it receives prior to its attempts to read them to
enable graceful handling of these issues instead.

Changes
-------
Added additional validation on packets that were not
previously validated prior to reading.

Change-Id: Iac797d5ae937b34872ca0589e53006a0da0af0ae
Reviewed-on: http://review.couchbase.org/93080
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>
Reviewed-by: Michael Nitschinger <17b9e1c64588c7fa6419b4d29dc1f4426279ba01@nitschinger.at>
Tested-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>
Reviewed-by: Jaekwon Park <055e5bc0d00f1b5117b7b2b05f54b5782e38dc8e@couchbase.com>

brett19/gocbcore