Cleanup packet handling functions

Make a unified 'packet_info' structure for passing around a header and
its payload.

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