Most long haul aircraft carry a body bag or two and should a pax die en route then it would be quite normal to place them, in the bag, in a toilet and lock the door so that other pax can't use it.
Every thing else relevant has been mentioned already, especially the risk of an unscheduled landing in a foreign country with a dead person on board.
If you land in the UK with a dead passenger on board then everyone has to remain on board until a doctor confirms that no foul play is suspected, police will attend and stand by any open doors until the aircraft is cleared.