This patch fixes a number of embarrasing oversights which meant libfdt did not work correctly on little endian machines. With this patch the testsuite now passes on x86. Device trees are always created big-endian.