That would be why the FAA has a rule that there must always be at least two people in the cockpit if the door is closed. In the US when a pilot needs the rest room a flight attended will take the pilots place (and usually leave the door open while watching it at that).
As the other person commented: instances of pilot suicides like this occurred outside the US, not under FAA justification.
As the other person commented: instances of pilot suicides like this occurred outside the US, not under FAA justification.