This is a reference to the traditional attire for a British judge, whose wig is made of horsehair.
According to the Sunday Times (13 July 2007), "Judges are to end centuries of tradition and abandon the wearing of wigs and gowns in hundreds of civil and family cases. The decision to abolish the 300-year-old horsehair headgear, along with wing collars and bands, was announced yesterday by the Lord Chief Justice, Lord Phillips of Worth Matravers. However, in a compromise ending one of the most hotly disputed legal debates of recent years, judges sitting in criminal courts will continue to wear their wigs."
Attire for various judges around the world can be seen here.
This is a saying similar to "the fly in the ointment" (see second Bookmark for page 35).
How this example of "the n word" managed to stay in the novel when all other instances have been expunged is beyond me.
In English courts of law, the judge's black cap was a nine-inch square of black silk that the judge would place on his head prior to pronouncing the death sentence on a convicted prisoner. After doing so he would say, "The sentence of this court is that you be taken to a place of execution and that there you be hanged by the neck until you are dead. And may the Lord have mercy on your soul."