Apple wins big with U.S. tax bill but faces snag on foreign patents