app: fix selected layers in duplicated image.
This seems to have been broken since much longer, but it only made a problem with recent changes. Since we were duplicating layer groups and contents layers at once, the current code could not keep layer selection other than at root level in a duplicated image. Use the layer paths to make sure we select exactly the right copied layers, since the path should not change in a fully duplicated image.
Showing with 17 additions and 7 deletions