Include config.h as the first header file

Change-Id: Ia8a0759692377217c50ea6a4256a438f25ecac30
Reviewed-on: http://review.couchbase.org/26905
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>