Just an extension on what has been previously mentioned. McCluskey did go to dinner to be a guard to Solozzo. This was part of the precautions taken by Solozzo due to the fact that he knew he would be the one that would be taken out and there was a price on his head.

Although, taking Solozzo out would be wholy justified and permissible by the council and Cosa Nostra Law, some of the motivation of Solozzo and undoubtably the Tattaglias and by extension Barzini in bring McCluskey as the bodyguard was A) No one would touch a cop because they would be declaring war on the cops. B) If the Corleones were to take out Solozzo they would have to take out McCluskey and if they did they would have the police on them as well. This would give Barzini and the Tattaglias an advantage and allow them to start a war with the Corleones thereby taking their power.

Michael quelled this by using their connection to paint McCluskey as a corrupt cop (which he was) who got mixed up with organized crime.