graphics/p5-Cairo: fix runtime crash
PR: 288054 MFH: 2025Q3 (cherry picked from commit 0712351c53ce3027fbb549c4b18bf654851080f7)