ldb: Avoid multiple tiny allocations during full DB scan