Add support for flush.

Change-Id: I4f863be52d98e008e5d612066cd75c78ff2a4f43
Reviewed-on: http://review.couchbase.org/39110
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>