The EU has managed to address critical risks to the security of its energy supply, a European Commission report shows.