Resolves: fdo#86449 CVE-2014-9093 backport rtf fixes

The actual bug is against 3.5.4 and 4.2 doesn't crash in anything like the same
way but it does still crash. So these fixes stop the provided examples from
crashing in 4.2 on using top on an empty stack, which isn't the same as
actually being a fix for CVE-2014-9093 as seen in 3.5.X

empty Reference

valgrind + bff

(cherry picked from commit 0a42632a74596cbc781746931bf8f2650994b80f)

empty m_aStates

valgrind + bff

(cherry picked from commit e3247719911f4e9b61ec43ea1c9ce04bcddc4ff8)

3bd526b7ebf0f4fce5d0c7054809e0dc2908e73f
Reviewed-on: https://gerrit.libreoffice.org/12965
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>

(cherry picked from commit b4840d3632e4404bee4bd192a7db916cbad3a401)

Conflicts:
	writerfilter/source/dmapper/DomainMapperTableHandler.cxx
	writerfilter/source/rtftok/rtfdocumentimpl.cxx

Resolves: fdo#86451 guard all the tops post pop

Reviewed-on: https://gerrit.libreoffice.org/12966
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 566300ebd57e6ff07fdb014321e23a92c9bcf5ee)

Conflicts:
	writerfilter/source/rtftok/rtfdocumentimpl.cxx

98be6f014893dfc7cee770c44cd9d0be32b39f5c

Change-Id: Id3c039a46dec5d2d4a4642dfb53d23a76972dde2