insert a newline before shell functions

If the user ends their existing shell script (.bashrc or .zshrc) without
a newline, then it can lead to an error. It is safer not to assume a
newline at the end but insert one anyway.