dm table: rework reference counting