Recently in Africa a suicidal pilot crashed a regional jet[1], killing all aboard, after sending the co-pilot back to check something in the cabin. Due to the locks nobody could re-enter the flight deck (might not have mattered, but who knows). "[The] cockpit voice recorder and flight data recorder revealed, that the captain was alone on the flight deck, banging on the flight deck door could be heard on the cockpit voice recorder"
Passenger aircraft are supposed to NEVER operate with only one person on the flight deck, but rules are not always followed.
We don't know how many hijackings have been prevented by the locking doors. Are there any documented cases? We do know of a few cases where they have caused deaths, or at least prevented any chance to try to avert a disaster.
1: http://avherald.com/h?article=46c3abde&opt=0