MB-12179: Refactor database scan code

This change splits the database scan (called dump in our API's) into
three separate phases. The first is initializing the scan, the second
is actually doing the scan, and the last is closing the database. One
fundamental change is the fact that we now keep a handle to the
database file in the KVStore until the handle is closed. This change
paves the way for allowing us to have pausable backfills.

Change-Id: Ifa1b6f9524fe5b20d6d522fcbabb822e36e66957
Reviewed-on: http://review.couchbase.org/41826
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-12179: Make the scan API's accessable through the KVStore

Change-Id: Iec845dd48b5f753ddee13793c8c2973196a1eb0a
Reviewed-on: http://review.couchbase.org/41827
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-12179: Remove the old dump API's from the KVStore

We should now use the scan API's that were added in the previous
patch-sets.

Change-Id: I788aee255a3d8e87e8f6dff938a15bbe054038a6
Reviewed-on: http://review.couchbase.org/41833
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-12179: Move dcp backfill into its own file

We are going to be making a fair amount of changes to this class
and it constitutes having its own file.

Change-Id: I4139ef360fdb823b16348c2c1bc010868f47c5d8
Reviewed-on: http://review.couchbase.org/41834
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-12179: Make DcpBackfill class a state machine

Change-Id: I7e14fba6dcd91810ea83f8c5836ce4e0507a926f
Reviewed-on: http://review.couchbase.org/41835
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>