Bug 1065924 - Make sure we correctly update the variables tracking the number of samples written. r=jesup

--HG--
extra : rebase_source : 0f42c4a6d612a98f56edf93811cccca6d210795e