UndoManager: bug fix for empty user actions

Empty user actions can happen in gnome-builder for example.