Somewhat randomly, but this works for sessions that are stuck and cannot be seen on in the "ps -aux" from shell, or the "show system users no-resolve" output from the CLI.
I had a situation whereby the SSH connection wasn't active, however the device seemed to think a user was still logged in; fortunately it had its PID. Using the above command, you can kill the phantom session and your configuration mode should be empty once again.
This was also on an MX, so I'm sure it will work cross platform.
------------------------------
ANDREY LEO
------------------------------
Original Message:
Sent: 02-03-2012 07:50
From: csnow
Subject: How to clear these sessions?
I found it....disregard.
"request system logout pid"