internal.h: reorganize includes

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