(related: fdo#79319): writerfilter: RTF import: don't lose shapes in header

With a horizontal rule, it's possible that there is no \par following it
in a header, so RemoveLastParagraph() will delete the paragraph where
the shape is anchored (and so the shape as well).  Avoid that by adding
an extra \par if there is no \par following a shape.

(cherry picked from commit 9aa80fcb291083dc2a396db3d1be756eb4a0e54b)

Change-Id: I4840417880c98203866c9dcde51627516618f2d0
Reviewed-on: https://gerrit.libreoffice.org/10389
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>