The row-store reconciliation code uses a single buffer tmpkey, both to hold keys that are used for various history-store file purposes and and overflow key instantiation, as well as the source for the fast-path of prefix compressed key instantiation. I can't find a bug, but it depends on the guarantee the buffer is a good prefix source for itself and the code is complicated enough that I don't trust it.
Split the buffer usage into two cases and don't let them combine.