ldb: Reset error string before running prepare_commit() hook