dm: Fix error handling when unflattening the DT