libfdt: Add max phandle retrieval function