Resolves: fdo#60040 crash after undoing master page application

 regression since 839cb94a2bd9dfadb6a7e11a97f0540a78f79b6b

Change-Id: Ie7068ecd1655ecae169948dc1e08330dc4200bf9
(cherry picked from commit f756fb84a1629d455ccbd7af1f3975ac307fb957)
Reviewed-on: https://gerrit.libreoffice.org/9150
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>