Corrected document unlocking (closes #3954)