European Union countries approved an agreement with China to curb imports of Chinese solar panels, ending the EU’s biggest commercial dispute of its kind.