inlined maybe_flush_docs

Change-Id: I4897c6689c9b441964bf1ec0ab6d0142440e54f5
Reviewed-on: http://review.couchbase.org/37555
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>