Run shell scripts through shellcheck

It's not just mingw, this change stops e.g. the examples from being built when we want, since cmake doesn't see that option.