Selection sort in C