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.
This instance will be upgraded to Heptapod 18.5.1 on 2025-11-13 between 17:00 and 18:00 UTC+2
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.