Mergesort implementation in C