Reset SelectionHandler state upon exception

Reset state upon exception. Otherwise text selection gets broken.