@Albert Hardvendel Regarding the above mentioned ask, while testing came across this setting "show a warning when leaving log analytics with unsaved edits" set to off, will help you to achieve the desired result.
I have set this setting to off and made changes to the query and while closing the same, there is no notification being triggered.
Let me know if you have any further questions, or if my understanding of the issue is incorrect, lets connect offline for better understanding of the issue.