Previous there was a case:
1. Auto attach was enabled in user settings and workspace A was open
2. Switch to workspace B, and then turn auto attach off in user settings
3. Switching back to workspace A, environment variables were not cleared
Now, the last state is stored in the workspace settings so that
we can tear down the previous state if necessary.