configure: fix all except one warning produced by shellcheck

thanks to @bska for pointing this tool out!
Merge pull request #440 from andlaus/fix_shellcheck_warnings

configure: fix all except one warning produced by shellcheck