[PATCH v2 28/45] dm: core: Add a macro to iterate through properties