Corrected document unlocking (closes #3918)