Or a folding door between the seats and the galley. It wouldn't have to be exceedingly sturdy, just enough to deter a rush to the galley in the few seconds the cockpit door is open. Shut it some minutes before a crew member comes out and reopen some minutes afterward.
No one should object to being asked to momentarily step back from the galley.
-PJ