Bug 1053647 - delete space when reverting an autocorrection and don't insert space when user selects a word suggestion

Follow up of #23794