Four companies including mega retailer Walmart have settled a dispute with the Justice Department and agreed to pay a fine over job postings that discriminated against non-U.S. citizens.