It's a reference to Treasure Island.
I didn't know the answer either, so I googled "Mightn't happen to have a piece of cheese about you, now, would you boy" and got a ton of results.
One of the results is this copy of a book called Treasure Island (Robert Louis Stevenson, 1883). Apparently it's a direct quote from the book:
"Marooned three years agone," he continued, "and lived on goats since then, and berries, and oysters. Wherever a man is, says I, a man can do for himself. But, mate, my heart is sore for Christian diet. You mightn't happen to have a piece of cheese about you, now? No? Well, many's the long night I've dreamed of cheese--toasted, mostly--and woke up again, and here I were."
Another result (in fact, the first result) is this Reddit thread where user Alto_DeRaqwar explains why Deckard quoted the book:
Ben Gunn was a pirate; abandoned on Treasure Island by Captain Flint when he first buried his treasure. During his long sojourn on the island he develops a craving for cheese and when found by Jim (the main character of TI) it's one of the first things he asks for.
So part of it is a joke on Deckard's part; he's been long stranded in Las Vegas and one of the first thing's he asks for is cheese; indicating he's the long suffering Ben Gunn abandoned by his crew mates. However a second subtler inference is around the fact that Benn Gunn also knew the true hiding place of Cpt Flint's treasure; he had found it himself and hidden it elsewhere and he would have told Jim but Jim never asked. In this case the treasure was the child and K thought himself to be the treasure; whereas if he had asked directly Deckard would have revealed the truth that it was a daughter not a son.
Here is another Reddit thread. This answer comes from user lowbrowhijinks:
The line is said by Ben Gunn, a sad man who had been marooned alone on an island some 3 years. Having had no contact with any other person
in that time, upon being discovered he timidly asked about the cheese.
He had craved it after subsisting on goats, berries, and oysters.
He had been abandoned by his peers to search for a treasure he never
There are certainly parallels between Deckard and Ben Gunn. Both were
exiled/marooned by those they associated with. Both were meeting
someone after years in exile.
Interesting as well is that the protagonist Jim says "I could now see
that he was a white man like myself" and in the ensuing conversation
Ben describes himself as being pious to ingratiate himself with Jim.
He is essentially saying "This wild hermit you see before you used to
be just like you." Both knew the same people and had the same enemy
(Long John Silver.)
There's certainly a subtext to be gleaned here- Deckard, like Ben,
could be said to be communicating the idea "I'm not so unlike you."
Deckard even says "I used to have your job once. I was good at it."
The movie doesn't ever come out and just say it (like Ridley Scott
did) but this seems to be a very subtle clue that Deckard is a
replicant. He is the older, wilder, raggedy exile version of K.
Also apparently there's a deleted scene from the original Blade Runner where Holden says he's reading Treasure Island. Here is a clip.
There are a ton of other discussions on this topic. I recommend checking out the Google search if you're interested.