MB-11661 Move cursor to the next checkpoint if reached to the end

If a cursor is already reached to the end of its current
checkpoint, then the cursor can be moved to the next checkpoint.
In this way, a checkpoint can be immediately freed from memory
if the checkpoint doesn't have any cursors.

Change-Id: I378d0e2527610d7ad7773ebd35e3814d31bb7777
Reviewed-on: http://review.couchbase.org/39339
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>