Peter Nap's answer was accurate, precise and to the point. And if they ask, say, "I prefer not to chat just now, thank you, Officer; am I free to leave?" As with any negotiation situation, you have to be ready to call their bluff.
With respect to the later accretions, I'd add that, when passing through a state hostile to your right to defend yourself, Maryland being a glaring example, you must secure the firearm unloaded inside a container. A lock on the container would be a good idea for purely defensive legal reasons involving the requirement of a search warrant. I've heard, however, that Maryland treats the Firearm Owners' Protection Act as an "affirmative defense", which means they may still arrest you and make you stand trial, even though they know you have a good defense. Second point is that the phrase, "passing through" is critical. Bathroom and similar incidental stops (food, gas) are ok, but overnight lodging, stopping for business reasons (e.g., to drop off that load of frozen shrimp) or sightseeing within the state is not - that's going to a destination within the state and you lose the protection of the federal statute when you do that.