of/flattree: Refactor unflatten_device_tree and add fdt_unflatten_tree