Stop leaking all ScPostIt instances.

And re-implement correct swapping of two ScPostIt instances during
sort.

(cherry picked from commit ab05317c79f665bcf9d5cff7b8312ce6963ff969)

Change-Id: Ifbf120aae594342ae0b7c5760f771c53092c8022
Reviewed-on: https://gerrit.libreoffice.org/7641
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit b5f9c2be36f935f0009c2d7c40f7fadebf0b7ef8)
Reviewed-on: https://gerrit.libreoffice.org/7695
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>