actions: optimise string handling in follow_link()

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: use access() as an initial validity check in contained_followlink()

if access() returns error then the symlink cannot be dereferenced
for some reason, and it is pointless walking the symlink because it
will fail.  This also deals with cases where a symbolic link is
circular, generating -ELOOP, and so we don't have to worry about
dealing with loops ourselves.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: implement stat(expr) - eval expr on the file pointed to by a symlink

evaluate the expression using the context of the inode
pointed to by the symlink.  This allows the inode attributes
of the file pointed to by the symlink to be evaluated, rather
than the symlink itself.

Note, stat() deliberately does not evaluate the pathname, name or
depth of the symlink, these are left with the symlink values.
This allows stat() to be used on any symlink, rather than
just symlinks which are contained (if the symlink is *not*
contained then pathname, name and depth are meaningless as they
are relative to the filesystem being squashed)

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>