of: Add memory limiting function for flattened devicetrees