Court hands defeat to NC GOP in election law clash