speed up file merging

Our file merging is dominated by very heavy comparison function. I've
spotted that previous binary-heap-based implementation was doing log_2
N comparisons twice per record. First to put record into heap and
second to remove it from heap.

Because we're doing 16-way merge (and we don't anticipate it being
much wider), I thought that simple insert-sort maintained sorted
vector would beat it. Particularly removal of least element does no
comparisons (it does memmove instead, but on short array that's very
cheap). And insertion does binary search to find position and memmove
to "create hole" for insertion.

Experimental results confirmed my finding. Particularly building
primary key index of 15E6 elements took 606 seconds instead of 665
seconds.

I have to admit that I've expected far bigger speedup but I now see
that I much understimated N log N factor of internal sorting of file
chunks, where smaller scale index sorting takes most of it's time.

Change-Id: I6da02231096d5138d19f9b0bb9e9d8b8175a2440
Reviewed-on: http://review.couchbase.org/29393
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>