a11y: Fix a crash at text deletion

https://bugzilla.gnome.org/show_bug.cgi?id=727587
(cherry picked from commit a20f7d2864850fa5e330b3f35f698082f97e5517)