removed DocsFlushed arg of maybe_flush_docs_xmem. it is always 0

Change-Id: I720f267729c3e89cb80a48b9dea0f33d1b41b3b9
Reviewed-on: http://review.couchbase.org/37557
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
converted local_process_batch into tail call recusion

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