MB-8531: Build tree from sorted file

For the initial index building the key-value pairs are sorted
externally by couchstore. The vtree_copy:from_sorted_file/4
reads such a sorted file and builds an vtree bottom-up.

The code is mostly a copy of the couch_btree_copy module.

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