MB-9730 Add support for couch_file to refresh EOF

The couch_file process and its child writer process keeps track of
EOF information. This EOF position is incremented when data is
appended to the file by the writer process. The reader also
makes use of stored EOF position for reading latest header from
the current file process.

When an external process opens the same file and appends data into
the file, the EOF information held by the couch_file process becomes
invalid. Hence, we need to update the EOF information held by the
couch_file process explicitly.

Added couch_file:refresh_eof(Pid) method to refresh the EOF position
by reopening the backing write fd for the file.

Change-Id: I427646e0a0707a2ccaca5af8a354552dc184dfc8
Reviewed-on: http://review.couchbase.org/30989
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-9730 Integrate native viewgroup cleanup support

An external native program `couch_view_group_cleanup`
is invoked to perform viewgroup cleanup. On successful cleanup,
viewgroup couch_file processes are refreshed to use new views
after cleanup.

A comparison of time taken for cleanup before and after this change
benchmarked by running `test/11-updates-cleanup-many-views.t` with
6400000 documents are as follows:

Before:
Removed 30000 values from the index in 4.468 seconds

After:
Removed 30000 values from the index in 2.364 seconds

Change-Id: I1ef010a5c1dad8366e90dbbba4bf93117a92377f
 MB-9730 Add support to stop cleaner native process

stop_cleaner() function needs to ensure that the
viewgroup cleanup native process has exited.
Added a mechanism to send exit message to native viewgroup
cleanup process and wait for process to exit and send exit status.

Change-Id: If187e2114a0608a8f704f6b43a3c36a4817035ab
Remove an unused variable in rollback unit test

Remove an unused variable since it is violating the fact
that couch_file process pid can change in between updates since
viewgroup cleaner resets the couch file process for the viewgroup.

Change-Id: I8e3f9020e769c195970ae2984ea4bcaf2d5afee6
MB-9771 Integrate native incremental index updater

The main updater-writer process creates batches of incremental
changes to be applied to the view btrees and id btree. The list
of operations for each batch are written into a sorted file (one
for each btree in the index file). The viewgroup info along with
the sorted file paths are passed to an external native process.
The external process reads the operations from the sorted file and
applies to the btrees in the index file efficiently.

Change-Id: I122252a3803c29ac9351b8902e939c8c17c02825
MB-9771 Remove sorting step for incremental mapreduce view updates

For mapreduce views, native incremental index updater performs sorting
of btree ops before performing the update. Hence, sorting is not required
to be done from erlang side.

Change-Id: I433731c7bd9f6e1b75a5e120bfb1c98c39f7e7c9
MB-9771 Use port stream option to read stdout response

For native incremental index updater, use stream method to
read lines from stdout and parse view group header.
Earlier {line, N} option was used to receive stdout response.
It has limited control for receiving binary raw data (header data)
since the port driver itself tries parse lines.

Change-Id: I4104d494a7e56031e4e60cb7599d8382c10d0f3a