Fix unintentional free of the last value when adding a new value to a key.