MB-8903: Simplify header parsing

Change-Id: I9e24502b8aea7a589f1edbcc19c063cf9daa605c
Reviewed-on: http://review.couchbase.org/29408
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>