driver core: prevent device_for_each_child from oopsing