sampling: allow window=1 in AdvancedStatsFunction

A few sampling functions do not need a real sampling window,
yet they are forced to use window=2 because it is the minimum
allowed size.

This patch adds support for the window=1 special case, and a new
method to fetch the sample on this case, because the existing
API does not fit really well.

This patch also adds the initial wave of unit tests for
AdvancedStatsFunction.

Change-Id: I2ce1fed5a211ed58b7df4728d5bfc3c17fccfbd8
Signed-off-by: Francesco Romani <fromani@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/28992
Reviewed-by: Dan Kenigsberg <danken@redhat.com>