MB-8029 More efficient and simpler index build

Instead of accumulating small buffers in memory, sort them
and write them to disk while in parallel other KV batches are
being merged (on disk), keep the process simpler by just writing
all KV pairs into an unsorted file, and at the end sort those
files with the C file sorter in couchstore (couch_view_file_sorter
program). This approach is faster in C, but was attempted in the
past in Erlang and verified to be slower than current approach.

The goal of this change is mostly to move some work out from Erlang
to C, and is ground work for more incoming changes that will allow
moving all of the index build/update to C.
Another positive side effect of this change is that overall CPU and
memory consumption was smaller than before (Erlang!).

One of the tests that was done to measure performance follows.

Building an index for a design document with 4 views, from
one of the evperf tests, for a dataset of 20M documents:

Before this change:

Indexing time:   44m55.362s
Final file size: 2.3Gb

After this change:

Indexing time:   33m13.003s
Final file size: 2.3Gb

Change-Id: Ia7b3a0114e03d0110af2c749787fec7187d46ca0
Reviewed-on: http://review.couchbase.org/26194
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>