Fix to mis-calculation of curOffset in BnodeMgr
Fix to mis-calculation of curOffset in BnodeMgr

* if 'remainig_size' is equal to 'blocksize_avail', 'curOffset' is
set to 0, then the next block will overwrite the current block.
We lost the current block so that crash happens.

Change-Id: I70e96fb1e9415fe73bc12a89a47798487ada3130
Reviewed-on: http://review.couchbase.org/70598
Reviewed-by: Sundararaman Sridharan <333a3f71d3ad6e01fc953c4fa06bc1f3cd014910@couchbase.com>
Tested-by: Sundararaman Sridharan <333a3f71d3ad6e01fc953c4fa06bc1f3cd014910@couchbase.com>

wurikiji/forestdb,couchbase/forestdb,wurikiji/forestdb,couchbase/forestdb