[JENKINS-9120] Add test

(cherry picked from commit 777d232053488b2dcedc122529283c6e69e99c95)
[FIXED JENKINS-9120] RingBufferLogHandler has int that needs to be reset.

(cherry picked from commit 67838866c6c851adc8e39dbd20ff81a434cf6cc6)
Better null safety.
Defense against an exception consistently thrown when running functional tests against 1.532.1 (but not 1.540, for whatever reason):
… hudson.PluginWrapper stop
WARNING: Failed to shut down …
java.lang.NullPointerException
	at jenkins.model.Jenkins.lookup(Jenkins.java:3898)
	at hudson.PluginWrapper.getPlugin(PluginWrapper.java:287)
	at hudson.PluginWrapper.stop(PluginWrapper.java:377)
	at hudson.PluginManager.stop(PluginManager.java:650)
	at org.jvnet.hudson.test.TestPluginManager.reallyStop(TestPluginManager.java:129)
	at org.jvnet.hudson.test.TestPluginManager.access$000(TestPluginManager.java:55)
	at org.jvnet.hudson.test.TestPluginManager$1.run(TestPluginManager.java:140)

(cherry picked from commit 6586d779b1652ac91c20e2bb11f8915d1e36beea)

Conflicts:
	core/src/main/java/hudson/PluginWrapper.java
[FIXED JENKINS-17929] Pick up transport authentication from groovysh command, by overriding run rather than main.
(cherry picked from commit 3896aabc0bee39fd94366f5b2dd6bc191c040e40)

Conflicts:
	changelog.html
	core/src/main/java/hudson/cli/GroovyshCommand.java
[JENKINS-17929] Noting that authentication does not work in the groovysh command.
(cherry picked from commit b9e227e65bff87949d46fc4313020428f48d0fa4)

Conflicts:
	core/src/main/java/hudson/cli/GroovyshCommand.java
[FIXED JENKINS-18410] AbstractTestResultAction should be a RunAction2 so it need not persist its owning build.
(cherry picked from commit fcdf74991226fb6869052caa89ed8d678944b6fc)

Conflicts:
	changelog.html
[JENKINS-18410] NPE from previous fix (fcdf749) under some conditions, which the test case was not exercising.
java.lang.NullPointerException
	at hudson.tasks.test.AggregatedTestResultPublisher$TestResultAction.getProject(AggregatedTestResultPublisher.java:173)
	at hudson.tasks.test.AggregatedTestResultPublisher$TestResultAction.<init>(AggregatedTestResultPublisher.java:146)
	at hudson.tasks.test.AggregatedTestResultPublisher$TestResultAction.<init>(AggregatedTestResultPublisher.java:135)
	at hudson.tasks.test.AggregatedTestResultPublisher.perform(AggregatedTestResultPublisher.java:90)

(cherry picked from commit bfaab5118d079405b82b80301d90e19f39970366)

Conflicts:
	changelog.html
[FIXED JENKINS-20928] l:breakable mishandles HTML metacharacters

(cherry picked from commit 3f1f122ff415319b6408ab89f8b3ff0bf4da597d)
[FIXED JENKINS-21078] Optimizing loadIdOnDisk.
(cherry picked from commit a6e01f77c6d3d72f7ac9e99ce061ce04dbf4b515)

Conflicts:
	changelog.html
Cherry pick test/src/main/java/hudson/cli/CLICommandInvoker.java from 29d441331e3e9e0fc22c0ca07d97133f609c6f0b