Fix sorting of CopyOnWriteArrayList.