I work for a college police department (not as an officer), and knowing a few things about cops, here are my suggestions:
If you're in an area where smoking is allowed, you have a right to smoke the pipe. Smoking a cob would almost certainly not qualify as a reasonable suspicion that you're doing anything illegal, which is the legal standard to initiate a stop. It DEFINITELY doesn't qualify as probable cause to initiate a search without your consent. That said, police officers can ask you anything you want. How I would answer in that situation would depend on a number of factors. Is the cop asking out of friendly curiosity? If so, there's nothing wrong with being social. He may have an interest in pipe smoking himself. If he/she was being accusatory, I'd be a lot less friendly and willing to talk. Feel free to ask the direct question: Am I being detained or am I free to go. Ask it until you get a yes or no answer. The truth is that even if most police officers are hard-working, decent folks (and most are), there is a "compliance culture" that has permeated the profession here in the U.S., and so some officers do not seem to show enough respect to the idea that if a citizen is not doing anything wrong, they have the right to be left alone.
I'm new to pipe smoking, but I use cobs. I don't hesitate to smoke them in public. Can a cob be used to smoke cannabis? Sure it can. But so can a briar or meerschaum or a can of pepsi, or even an apple. Smoking a cob is not sufficient by itself to be suspicious.