MB-9507: Flush stdout at the end of every batch output

By default, Python's standard out is buffered
(meaning that it collects some of the data "written" to standard out
before it writes it to the terminal). Calling sys.stdout.flush()
forces it to "flush" the buffer, meaning that it will write everything
in the buffer to the terminal, even if normally it would wait
before doing so.

Change-Id: I30752e42290f6e3f9254b0b9756fbb413e706395
Reviewed-on: http://review.couchbase.org/30235
Tested-by: buildbot <build@couchbase.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>