ldb: Avoid use-after-free when one error message is printed into another