prepare-commit-msg: Avoid warning on macOS and shellcheck fixes
The macOS /bin/sh complains about using return outside of functions.
Replace return 0 with exit 0 to fix this. While editing this files
I've also fixed all the shellcheck warnings that were displayed by my IDE.
Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D28016