At least it reduces your vulnerability if you only unlock them for the few seconds it takes to step through for the toilet, I suppose. If they've some means to verify there's not a knife wielding maniac waiting outside the door the risk's probably minuscule.
Still. You'd think they'd have a toilet as part of the secure area on bigger planes - which I imagine is where most of the pilots who need to visit the men's room are. >_<