Bug fix.

Fixed a bug in heapsort.c where an out-of-bound array access would occur
during the first heapify step.