CCBC-438: Set proper datatype flags for incoming data

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