CBD-1217:  fix data errors in last_commit_valid(),
           better error messages about missing or invalid cgi params

Change-Id: I26554711368464db77587b4b8b686546d97c79a1
Reviewed-on: http://review.couchbase.org/33339
Reviewed-by: Philip Labee <philip@couchbase.com>
Tested-by: Philip Labee <philip@couchbase.com>