CBQE-1: parameterize _end_replication_flag

in the case we do not want to run stat keep threads in background

Change-Id: I8925ad5775e187b39f5cb16a19cef4c761b4ae21
Reviewed-on: http://review.couchbase.org/23926
Reviewed-by: Tommie McAfee <tommie@couchbase.com>
Tested-by: buildbot <build@couchbase.com>