Bugfix to lineinfile module to properly handle files with no newline at EOF

Currently when using lineinfile with insertafter=EOF for a file that has no newline at EOF then the added line is not prefixed with a newline. Instead it's joined with the last line.

As a concrete example, Ubuntu distro default /etc/ssh/sshd_config has no newline so lineinfile module cannot be used to add a new line to the end of the file.

Looks like #6881 is also affected by this bug.

This fix prefixes insertafter=EOF line inserts with a newline when needed (file is not empty and EOF has no newline).