Fix fold reduce with non-inclusive end key

Fold reducing a btree with with end_key_gt was not producing
the correct values. For example, for view queries with startkey
and starkey_docid and/or endkey and endkey_docid and inclusive_end
set to false, the doc ID component of the view keys was not
respected.
Example query:

http://server:5984/db/_design/test/_view/myview?startkey=4&endkey=6&endkey_docid=5&inclusive_end=false

Closes COUCHDB-1413
1 file changed