fdo#77720: Mail Merge: reset cursors after clearing document

The root cause for the crash is that the shell has an invalid cursor
that does not point at a paragraph; this is because first the document
is filled and the cursor is pointed at the content of a frame, then the
document is cleared from SwFrmCtrlWindow::Resize() [not sure why?] and
at that point the cursor remains on an SwEndNode (which is invalid).

Change-Id: I47c1e2a34d5579953c1896ff0895568978e72bc7
(cherry picked from commit abb0549dd1744a35b0464faac55999b0d5968212)
Reviewed-on: https://gerrit.libreoffice.org/9288
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>