MB-9154 ensure that stats rest api returns the same number of samples
MB-9154 ensure that stats rest api returns the same number of samples

... for system and for bucket stats

- this safeguard is needed since the sample retrieveing code
  does not guarantee that the same number of samples will be
  retrieved. so in the rare occasion when bucket or system stats
  will have extra sample, this extra sample will be discarded

- also on mixed clusters it is still not guaranteed that
  the returned number of samples will be the same. this
  code will fix it.

Change-Id: I219fe69430a9045761dd0271fe84fc5e88d22234
Reviewed-on: http://review.couchbase.org/29200
Reviewed-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>
Tested-by: Aliaksey Kandratsenka <340b8e09ca65cd3fc686427fcfed17e87eaf61e2@gmail.com>

nimishzynga/ns_server,t3rm1n4l/ns_server,t3rm1n4l/ns_server,daverigby/ns_server,membase/ns_server,ceejatec/ns_server,ceejatec/ns_server,ceejatec/ns_server,nimishzynga/ns_server,mschoch/ns_server,t3rm1n4l/ns_server,nimishzynga/ns_server,vzasade/ns_server,membase/ns_server,daverigby/ns_server,mschoch/ns_server,vzasade/ns_server,vzasade/ns_server,ceejatec/ns_server,mschoch/ns_server,mschoch/ns_server,ceejatec/ns_server,vzasade/ns_server,nimishzynga/ns_server,t3rm1n4l/ns_server,daverigby/ns_server,membase/ns_server,nimishzynga/ns_server,daverigby/ns_server,membase/ns_server,membase/ns_server,mschoch/ns_server,t3rm1n4l/ns_server,membase/ns_server,mschoch/ns_server,ceejatec/ns_server,nimishzynga/ns_server,daverigby/ns_server