Handle flush results correctly

as described in MB-11154 flush can result either in a 200 or a 201 HTTP
status, both of which need to be handled accordingly. The suggested
method is:

1. create a marker document
2. issue flush
3. if HTTP response == 200 flush finished correctly
4. if HTTP response == 201 flush is still running
5. poll the marker doc until it is gone to be sure flush is finished

Change-Id: I8d30fb6f76414d15dad68726477b1a14270d13f9
Reviewed-on: http://review.couchbase.org/38412
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Philipp Fehre <philipp@couchbase.com>