fix apparmor dereferencing potentially freed dentry, sanitize __d_path() API