Add test case which verifies the occurrence of #7409.
Make sure there's a line break before writing new key. Fixes #7409.
Remove any trailing white space.
Merge pull request #7494 from s0undt3ch/issues/7409-no-new-line-ssh-keys

Make sure there's a line break before writing new key