[SPARK-3377] [SPARK-3610] Metrics can be accidentally aggregated / History server log name should not be based on user input

This PR is another solution for #2250 

I'm using codahale base MetricsSystem of Spark with JMX or Graphite, and I saw following 2 problems.

(1) When applications which have same spark.app.name run on cluster at the same time, some metrics names are mixed. For instance, if 2+ application is running on the cluster at the same time, each application emits the same named metric like "SparkPi.DAGScheduler.stage.failedStages" and Graphite cannot distinguish the metrics is for which application.

(2) When 2+ executors run on the same machine, JVM metrics of each executors are mixed. For instance, 2+ executors running on the same node can emit the same named metric "jvm.memory" and Graphite cannot distinguish the metrics is from which application.

And there is an similar issue. The directory for event logs is named using application name.
Application name is defined by user and the name can includes illegal character for path names.
Further more, the directory name consists of application name and System.currentTimeMillis even though each application has unique Application ID so if we run jobs which have same name, it's difficult to identify which directory is for which application.

Closes #2250 
Closes #1067
I've checked Mesos' code and I found following things.

* FrameworkID is assigned by MesosMaster for each process which execute SchedulerDriver(for Mesos, MesosSchedulerDriver), and registration. Instances of MesosSchedulerDriver are contained in CoarseMesosSchedulerBackend/MesosSchedulerBackend.

* CoarseMesosSchedulerBackend/MesosSchedulerBackend#start is invoked, MesosMaster registers a framework to a registered-frameworks-list.

* When CoraseMesosSchedulerBackend/MesosSchedulerBackend#stop is invoked, Master unregisters a framework from a registered-frameworks-list.

So, I think we can use FrameworkID as an unique Application ID.