libglusterfs: Fix circular buffer to dump entries if count is less than 1024

Problem:
To dump the values present in the circular buffer, index always
moves from current index to used_len. But if circular buffer is not
completely filled even once then next index to be filled  and used length
value are always same which means it will never dump any value.

Fix: Modified the logic of buffer traversing to dump values so that  it
will still maintain FIFO and cover both the cases where buffer is either
partially filled or being used more than once.

Change-Id: If73a5e481cca1751d57aba1136c2d25d23ce073c
BUG: 972459
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/5197
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>