I have been doing some save scumming to try and define what happens here. My methods have been unscientific but may be relevant to a more robust investigation.
Each of my attempts have been done with multiple nothing-special Dwarves.
I have tried a normal method, as described in the wiki. The drop is directly into lava, originally intended to filter out iron equipment.
Prisoner escape rate for goblins is at about 70%.
I just build a hatch over the pit and forbid the trapdoor, the dorfs can still dump prisoners through it, but apparently the prisoners can't escape while being brought there if the hatch if forbidden...
I tried this and found no difference in escape rate.
I have then stripped the prisoners naked and attempted forbidden and unforbidden trapdoors, and even with no trapdoors, to no avail, but at least the dwarf wasn't shanked by the prisoners.
This then revealed far more
serious problems frivolity and amusement:
The dwarf who accidentally released the prisoner is now attacked by military dwarves and appears to cause a loyalty cascade.The dwarf who played the failed jailer did not appear as an @ as an insane or non-fort dwarf seems to. Anyone with more knowledge of dwarven sociology may wish to comment.
EDIT: Jacko13 seems to have found an answer almost 2 weeks ago in
http://www.bay12forums.com/smf/index.php?topic=141361.30, in which the issue of jailers being enemies is also discussed.
I've tried ensuring that only one enemy is alive in the pit at a time (easy with the lava) and can confirm I've had no escapees and no riots.
I suggest dropping them from a significant height to ensure that the dwarves don't get upset by previous victims being too close.