key_value.zig and params.zig: fix memory leaks and (#138)
* key_value.zig and params.zig: fix memory leaks and
use single allocation
params.zig and key_value.zig: could leak memory if
2nd (or 3rd) allocation failed. This is now fixed.
Number of Allocations is also reduced to 1.
* made the changes to key_value and params non-breaking
changes to key_value and params no longer break
anything on the user side.