The answer is, simply, no. He probably acquired it from the famed publication, The Nursery Rhyme Book edited by Andrew Lang and appearing in 1897. This is a traditional riddle in the English language, which is why it appeared in Lang's collection.
Riddles are traditional components of European folklore - as well as in many other cultures. Tracing the history of individual riddles can be extremely difficult: I could not find anything older than Lang's publication for this example, but that doesn't mean that such information doesn't exist. I am not an expert on this particular riddle.
No, he acknowledged as much in a 1947 letter to his publisher (The Letters of JRR Tolkien, #110):
As for the Riddles: they are 'all my own work' except for 'Thirty White Horses' which is traditional, and 'No-legs'.
Where exactly a man as well-versed on folklore and mythology as Tolkien got it is a more difficult question, but it'd been published in multiple anthologies before Tolkien's day, such as in The Nursery Rhymes of England, nr. CCXIII, 1853.