Make EDIT_UnlockBuffer cope with destroyed windows.