indexer: Implement refcounting for slice close/destroy

When an index needs to be destroyed, all the slice
resources (forestdb handles, physical files) need to
be deallocated. But, there could be a number of consumers
using slice resources while a drop index needs to be processed.

Added refcounting methods IncrRef(), DecrRef() that can be used
by consumers. Destructive functions Close() and Destory() will
become a lazy operation and will be performed only when refcount
becomes zero. ie, all the consumers have finished using the resource.

Change-Id: I1d3b10b96d2698099b8e4ef7420397bb3ba263d7
Reviewed-on: http://review.couchbase.org/44076
Reviewed-by: Deepkaran Salooja <deepkaran.couchbase@gmail.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Tested-by: Sarath Lakshman <sarath@couchbase.com>