I have looked over previous bugs on this one, for example 1489876, so I am aware that this "bug" is being closed as expected behaviour. Despite this, I am
concerned this is being overlooked and not discussed properly. This is a severe security concern and should be treated as such, if there are reasons it interferes with other elements it should be discussed as to any possible solution that deals with that. If it's not understood why this is such a large security concern I am happy to supplement this post with some examples based on my usage.
I would like to propose a possible method to handle this, of course just to add to any discussion you may have if looking into this. When the lock situation happens the variables of the current dialogue are stored and it is closed and locked, upon unlocking the dialogue can simply reopen as it was before.