I don't get the same pop-up. I tried both closing and returning, and there was nothing. It must be on the paid version of the analysis page. And I don't think there's a setting for such a thing.
If it really annoys you that much, there are browser add-on's and user-scripts you can play around with to disable the message in your browser.
Is there a setting somewhere that I'm missing that would allow me to close the tab for the analysis page without chess.com interrupting me and asking me if I'm sure I want to "leave the page"?
It's annoying to get a message like that especially when in order to close the tab you really have to go out of your way and find the X button on the browser tab, even if you do close it by accident you can always just re-analyze the game.
I must be missing this setting somewhere because I can leave all other pages, even when I'm playing, on this site.