It was fairly common parlance in the UK for quite a while.
Examples from Wikipedia:
The phrase is also used in The Razor’s Edge by Somerset Maugham. One of the American characters, on the brink of closing a business deal, says to the narrator, “I’ll fly down to Texas to give the outfit the once-over, and you bet I’ll keep my eyes peeled for a nigger in the woodpile before I cough up any … dough.”[9]
Agatha Christie used the phrase as the title of Chapter 18 of the 1937 Hercule Poirot novel Dumb Witness, which was later published in the U.S. as Poirot Loses a Client. The chapter was later retitled “A Cuckoo in the Nest”. The phrase was also used by a character in early editions of Christie’s novel And Then There Were None (originally released under the title Ten Little Niggers), but was changed in later editions to “There’s a fly in the ointment.”
English readers of the time would have been perfectly aware of the phrase and from my experience you would still have found people in the 80s who would have been incensed if you suggested there was anything wrong with the phrase.
These being people mind you who wouldn’t have dreamt of using the word towards an actual person.
See also Gollywog. Our history of racist language is not much better than the US.