Embattled retailer TJX Companies - the parent of TJ Maxx, Marshalls and other well-known outlets - has agreed to a nearly $41 million settlement with Visa.