Fix JS mergesort array swap to keep original array reference