Apparently the pilot asked the co-pilot to take control while he went to the toilet and was then locked out. Whatever happened there's clearly going to be an urgent review of procedures but you have to wonder what can realistically be done to prevent this sort of thing.
At least it appears that the passengers were not aware of the extent of the problem until the very last minute so, if that's the case, their suffering would have been briefer than would otherwise have been the case. If there is any small crumb of comfort to be had for the bereaved maybe that's it.