dm: core: Add functions for iterating through device children