rb: improve the performance of rb_put

when we call rb_put with a size greater than the size of the ring buffer
itself, we used to copy in a loop, overriding our new written datas.

it was very inefficient so we avoid these computations

closes #1