statedump: Print entries in cb buffer in FIFO order

Currently cb buffer was being printed in LIFO order, which
is was against the percieved notion of logs having older
entries printed before newer entries in the state dumps.

Re-did the loop to prevent crash as when w_index == 0, we
would access cb[w_index - 1].

Change-Id: Idd085f73fa6937e506a2a1925e42fbcfd2d9bb1c
BUG: 966847
Signed-off-by: shishir gowda <sgowda@redhat.com>
Reviewed-on: http://review.gluster.org/4968
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>