Fix wrong position of the merged layer
Before this patch, if you had a standard layer, then group
layer, then two more layers inside the group and tried to
merge them, selecting all and keeping the last mentioned layer
(inside the group) selected, the merged layer appeared on top
of the layers stack instead of the place of source layers.
After this commit, the merged layer is put in the place of
the active layer.
BUG:405686