Ensure focus is returned to the event trap after an undo

This behaviour regressed in c0332ed due to the caret overlay element
being moved inside the overlay itself. As a result, the event trap was
automatically being re-added after an undo, causing the SessionController
to incorrectly skip returning focus back to the trap upon completion.