(PUP-927) Read preserving line endings
Previously, puppet's built in file and template functions would
read file contents using File.read. This would not cause problems
on *nix but could cause EOL conversion from \r\n to \n on Windows.
Add Puppet::FileSystem.read_preserve_line_endings for cases where line
endings are important and use :mode => 'rb' checking first against utf-8
encoding, falling back to default_external when not valid, and falling back
to File.read when all else fails.