minor doc improvement
[JENKINS-18259] added a test to reproduce JENKINS-18259.
(cherry picked from commit 9c4cb4b5eca4fbeba5730b66f52042f647075ff8)
[FIXED JENKINS-18259]

Added a listener that gets called at the end of the test to provide opportunity for a cleanup.
This avoids the code duplication between HudsonTestCase vs JenkinsRule, too.