The keys and values are only to be used once because their memory is set
to zero. Make that explicit by moving the bytes into the lower level
methods.
This is a backport of core#19320 [2/2]
https://github.com/bitcoin/bitcoin/pull/19320/commits/fa8a341b88cabfd7f8d702db7cb9972b0804bf2a
Depends on D9982