Binary search tree implementation in C