Strip LF/LN from the end of the string in some special cases

This is done for more RFC 4180 compliance where every line should end with 0xd 0xa