Bug 879291 - [SMS] Properly exit edit mode before transitioning to another panel - r=gnarf

Closes gh-10208
(cherry picked from commit 48b2ec2b6a2f40730485159f75bca60ea5423c9d)