[SPARK-3479] [Build] Report failed test category

This PR allows SparkQA (i.e. Jenkins) to report in its posts to GitHub what category of test failed, if one can be determined.

The failure categories are:
* general failure
* RAT checks failed
* Scala style checks failed
* Python style checks failed
* Build failed
* Spark unit tests failed
* PySpark unit tests failed
* MiMa checks failed

This PR also fixes the diffing logic used to determine if a patch introduces new classes.
After lots of trial and error, I'm pretty sure this is the correct way to do this diff, and I understand why. A brief explanation is included as a comment earlier in the file.