The reference into the frame stack was only used before pop_back() and
push_back(), but a later change could read it after them. Copy the frame and
advance it through stack.back(), as the other stack walks do.
Signed-off-by: Niels Lohmann <mail@nlohmann.me>