Update index creation for Sphinx 2.4+
Update index creation for Sphinx 2.4+

From Sphinx 2.4 onwards, index entries have moved from
`env.indexentries` to `env.domains["index"].entries`, so we need to
check which is available and use the correct one.

rst2pdf/rst2pdf,rst2pdf/rst2pdf