tests: make checkheads tests bash-compatible by avoiding `echo '\n'`
Using echo with escape codes is not portable, so this patch replaces
it by printf. I also changed several nearby lines to printf for
consistency.
Using echo with escape codes is not portable, so this patch replaces
it by printf. I also changed several nearby lines to printf for
consistency.