[SPARK-3161][MLLIB] Adding a node Id caching mechanism for training deci...

...sion trees. @jkbradley @mengxr @chouqin Please review this.
An alternative solution to checkpointing is to recompute `nodeIds` from scratch every few iterations. It is reliable as long as the driver stays alive. If we do that, users don't need to set checkpoint dir and we don't need to manage checkpoint files. I hope the overhead is not big.