Check line endings based on OS family.

This is especially useful for CI tests on windows hosts where git checkouts perform an auto conversion to CLRF.