A federal judge has approved a $415 million settlement that ends a lengthy legal saga revolving around allegations that Apple, Google and several other Silicon Valley companies illegally conspired to prevent their workers from getting better job offers.