issue #2087: Sorts listeners only when flag is dirty. setPriority is only valid in fixed priority listener.