Delete node function for binary search tree