European court deals blow to controversial UK surveillance law