Bash: only ensure newline on Mac

There seems to be a compatibility problem on Linux with this, so we only
run it on Mac.