Fix #725: Escape newlines in test output messages