Oops, fixed bug in last commit

I should learn not to rename a parameter right before committing :-p
Also added a more descriptive error message when a bucket has an invalid
CouchAPIBase, to help track down couchbase/sync_gateway#147