MODE-2342 Fixed cleanup of open scoped locks on session.logout.