I think the phrase you're looking for is actually pinch a loaf. This forum discussed its origins, with one person writing:
Amazingly enough, none of my references give the history of "pinch a loaf." But I'm guessing that the process of kneading and shaping dough gave rise to the expression.
This slang dictionary supports your intuition about what it means:
He's in the bathroom pinching a loaf.
Another slang dictionary writes that the phrase is from 1994.
I have never, however, heard this phrase used. I'm an American English speaker, and at least in my experience this euphemism is not popular.