[SPARK-3038] delete history server logs automatically when there are too many logs

https://issues.apache.org/jira/browse/SPARK-3038
enhance history server to delete logs automatically
1 use spark.history.deletelogs.enable to enable this function
2 when app logs num is greater than spark.history.maxsavedapplication, delete the older logs