Document error codes more extensively

This adds proper error codes for each of the error constants (except a
few that aren't really used anywhere).

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