#33781 for 0.3.5: Strip '\r' characters when reading text files on Unix.

Merged Alexander Færøy requested to merge ahf/tor:bugs/33781_035 into maint-0.3.5

This patch ensures that we strip "\r" characters on both Windows as well as Unix when we read text files. This should prevent the issue where some Tor state files have been moved from a Windows machine, and thus contains CRLF line ending, to a Unix machine where only \n is needed.

We add a test-case to ensure that we handle this properly on all our platforms.

See: https://bugs.torproject.org/tpo/core/tor/33781

This is the 0.3.5 replacement for !34 (closed).

Merge request reports