Apache FOP Layout fix (bug 40798)

Layout fix
by
AD
(fixes bug 40798)

:

Bugzilla 40798: A conditional-page-master-reference with page-position="last" qualifies
for a first page, if it is also the last. Additionally: also added support for
page-position="only".