Yes, but more for incapacitation reasons than the flight attendant preventing the remaining pilot from locking the other pilot out. If one pilot steps out, and the remaining pilot has a heart attack, there will be someone left to open the door for the one who stepped out.
I'll play the devils advocate on this one.
When the flight attendant comes into the cockpit, with the co-pilot, how hard would it be for the co-pilot to get up to stretch and put a blind attack on the flight attendant? Guarantee you a person that has pre planned can put either sex down with one punch/move and continue flying the plane alone.
Doing so would still make the co-pilot the sole commander of the plane.
I'm not confident that protocol is valid. Its a feel good thing that some desk jockey thought up.