lddtree: fix symlink resolving

We need to print all intermediate symlinks and not only the final
target. All symlinks that points to an absolute path needs to be
prefixed with $basedir.
lddtree: list directories in LIST mode

when generating lists for initramfs images we might want include
directories so just print the dir instead of error.