Fix race conditions with starting/ending secure sessions
Created by: pR0Ps
The user could end a session, but before it actually ended, click the end session button again and get into a bad state.
This also fixes the opposite case (where the user has a secure session and tries to start one).