Stop using non-POSIX features in small test suite tests to avoid fake test failures

The following discussion from !1712 (merged) should be addressed:

  • @cs-shadow started a discussion: (+3 comments)

    Should we just use sh instead of bash? That would be available in even more scenarios, like mininal Docker images.

    I don't think we are using any bash-specific features.

This was attempted, but our usage of echo -e and especially non-POSIX features of trap make it not totally trivial to do.