Fix editing of nodes that belong to locked snapshots in the parent branch

If the snapshot is not from the current branch, it means it is  not locked in the current context.