Search node with a max key in binary tree using threads