Oxford English Dictionary (advanced search for the phrase in full text), says: "1842 J. WILSON Chr. North I. 84 By the time we reach the manse we are as dry as a whistle". The reference links to: Wilson, John. The Recreations of Christopher North 1842.
But even the greatest dictionary, like all of historical research, is a work-in-progress. Quite possibly, the actual first use was never even written down. Google Books gets 13 hits for the search: "dry as a whistle" date:1500-1842, so that is one possible avenue to try - bearing in mind that OCR (optical character recognition) can produce some wildly inaccurate dates. Also, Google necessarily ends up scanning many very old volumes that were bound with much more current books - which also throws off the results.