I have closed the whole program instead of just the window many times and I think others would have done the same
We have existing settings to stop this from occurring. The first one is to ensure you see this message when trying to close the program:
If you don't it's likley you asked to not display that message in the future. To bring back this message, go to Edit > Preferences > General and tick "Bring back all one time messages" This will ensure you don't close the application if you really don't want to.
The second option is to select View > Multiple windows This keeps the windows quite distinct from the application and hence less chance of making that error.