Refactor view record sorter to use system quicksort

The cpu timing benchmarks shows that list mergesort currently
used by the view record sorter is expensive compared to the
system quicksort. Refactored sorter to avoid building linked list
and use pointer array holders to make use of system qsort.

The sort time benchmark shows that there is a 2x improvement in
sorting time by using qsort instead of list mergesort.

Benchmark using an initial index build on tmpfs with 10M records and
3 views is as follows:

Before:
real   7m13.660s
user   7m13.344s
sys    0m5.796s

After:
real   5m35.510s
user   5m35.832s
sys    0m5.040s

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