SAN FRANCISCO, Dec 29 (Reuters) - A federal judge granted approval for coal producer Walter Energy Inc to reject its labor agreements and end retiree benefits, which the bankrupt U.S. company said was needed in order to sell off its operations, given the industry's dire straits.