XWIKI-10262: Manage the RenderingContext when running transformations outside of the TransformationManager

(Cherry-picked from commit 775f9365fe6abd2bb09ea8dab3cf319fc9316603 on master)