SAN FRANCISCO (Reuters) - Four major tech companies including Apple and Google have agreed to pay a total of $324 million to settle a lawsuit accusing them of conspiring to hold down salaries in Silicon Valley, sources familiar with the deal said, just weeks before a high profile trial had been scheduled to begin.