I would politely close this down, and use it as a teaching moment.
Parent to screener: I'm sorry, sir, but it's quite important to me to help our child understand the difference between a police officer and others who wear similar uniforms.
Parent to child: Johnny, when you need help, you should ask someone you know, someone who works in a store, or a police officer. But you should always first ask "Are you a police officer?" Can you ask this man?
Child to screener: Are you a police officer?
Screener: No, I blah-blah-blah...
Parent to child, cutting off the blah-blah-blah: This is not someone you should be talking to or asking for help. We do not know him, he does not work in a store, and he not a police officer. Let's go.
Take child's hand, walk away.