Issue #3358328 by alexpott, dww, mglaman: Improve how KernelTestBase manages its persistent key value storage (cherry picked from commit b6aef35b)