of/fdt: Convert FDT functions to use libfdt