Fix for JENKINS-16942

https://issues.jenkins-ci.org/browse/JENKINS-16942

PrintWriter.println() uses the OS specific line separator. When
SecretRewriter rewrites the secret file, the lines are converted to the
format of the running OS.  The test case does not account for this.
Since the test case is coded expecting line endings of \n, this fix
converts \r\n to \n before comparing.
[JENKINS-18074] Fixed unit test by making StubJob.getParent forgiving.
https://ci.jenkins-ci.org/job/jenkins_main_trunk/2545/testReport/junit/hudson.model/DisplayNameListenerTest/testOnCopied/