Terminate port file with new line

Most programs assume text files (not binary files) are new line terminated.
While going through the installation process of https://github.com/megaannum/vimside
which uses Ensime, I stumbled on this problem with Vimscript's
`readfile` function.
Make writePort more resilient to errors

More does not mean totally. For instance deleting the file could still
go wrong.
Merge pull request #291 from tsenart/add-portfile-newline

Terminate port file with new line