Fix newline conversion in tests to work with byte strings.