Optimize heapsort.

Halve the number of read/writes to the array in `downHeap`.