Closes #3478 (closed). Fixes an issue that causes Badger to retain old key-value versions.
Changelog: fix