scanner: Detect index state and respond accordingly

If an index is not in active state, any scan request towards
that index will receive `Index not ready` error response. If
an index is active and no snapshot is available (Eg. empty bucket),
scanner will respond with 0 rows.

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