Stage a space when inserting a special character

Avoids the inspector pointing at nothing as the main document
loses focus. Also move insertion to teardown process.

Change-Id: I182e04b84a853e3e7b4742b3888c0c25e5244d42
Merge "Stage a space when inserting a special character"