refactor buffer handling for DB puts

This commit fixes #5 
+ improves write-ops/sec
+ improves memory usage when inserting large values