RUBY-611 fixing usage of buffer after deallocation
RUBY-612 fixing usage of new buffer when potentially null
RUBY-533: Split bulk inserts into many messages