Tim Hortons, something of a national institution in Canada, gathered mountains of location data from users of its app, in violation of Canadian law.