MB-10874 Cleanup of stale db files

Replicated couch_db's cleanup logic of older revisions of db files
and compact files. Compact files are cleanned up during warmup or
after compaction failure. Older revision of db files are cleanned up
during warmup or when bgfetcher thread opens db files.

Change-Id: I207e502f06a16aeaf9e6eb2dfd857c19969bfa2c
Reviewed-on: http://review.couchbase.org/37101
Tested-by: David Liao <david.liao@couchbase.com>
Reviewed-by: Sundararaman Sridharan <sundar@couchbase.com>