[SPARK-3198] [SQL] Remove the TreeNode.id

Thus id property of the TreeNode API does save time in a faster way to compare 2 TreeNodes, it is kind of performance bottleneck during the expression object creation in a multi-threading env (because of the memory barrier). 
Fortunately, the tree node comparison only happen once in master, so even we remove it, the entire performance will not be affected.
This change is probably actually okay.  If there are multiple copies of the exact same UDF we can just compute the answer once.