Optimize createSelectorsForExtensionsRecursively (#14611)

The old code did modify the target selector with all extensions.
afterwards all extensions are applied to all modified selectors.
The code however did not check if any of the extensions actually modified
the selector.

The new code adds the modified selectors to the current set directly.
Only if this selector is not part of that set already it is scheduled for
recursion.
This automatically avoids infinite recursion, because any extensions
without effect terminate it.

Change-Id: I8c419fc9105f1ca323c6e8db30c60726ec87cc75