Pass unevenly sized raw types by pointer when encoding values

Change-Id: I875059d94d69f441453e56a744c2ef1f4c40dd85
Reviewed-on: http://review.couchbase.org/34366
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>