Add test for TreeNode.create_caches with duplicate tips