QuickSort implementation gets me an out-of-range error - C#