Altered when we transition into the disconnected state during connection.stop.

- This ensures that when the disconnected handler is called that we're in the disconnected state.
- Removed the try -> finally for this transition because the state transition now occurs prior to anything that would throw.
- Added a simple unit test to ensure that disconnected is triggered while in the disconnected state.

#2634