Changed worst-case ordo of replace(array,item1,item2) from O(n^2) to O(n).
Replace uses search_array, which in turn calls
check_array_for_destruct. So, if you had an array where all elements
were replaced by the replace containing at least one object replace()
was O(n^2), not O(n).
In general check_array_for_destruct is rather unneeded, since the
comparison functions already checks for destructed objects, but I
guess that it might cause objects to be free:d slightly sooner.