fix deadlock when appending logs to db fails