When copying a ref with the reftable backend we also copy the
corresponding log records. When seeking the first log record that we're
about to copy fails though we directly return from `write_copy_table()`
without doing any cleanup, leaking several allocated data structures.
Fix this by exiting via our common cleanup logic instead.
Reported-by: Jeff King <redacted> via Coverity Signed-off-by: Patrick Steinhardt <redacted> Signed-off-by: Junio C Hamano <redacted>