server-Inherited_ACLs: Added check for return value of strndup, improve detection of parent directory.

This is the same method that is used to traverse the path in kernel32.dll. Its still not perfect, because
the wineserver will easily get confused by symlinks. In this case the attributes should be inherited
from the real parent directory, not from the directory that contains the symlink.